from pandamonium.sockets import make_internal_socket


def test_internal_socket():
    client_socket, agent_socket = make_internal_socket()
    assert client_socket.read() is None
    assert agent_socket.read() is None
    client_socket.send('foo')
    assert agent_socket.read() == 'foo'
    assert agent_socket.read() is None
    agent_socket.send('foo')
    assert client_socket.read() == 'foo'
    assert client_socket.read() is None

edf36e2e77ac696101540a19883c02edb302c760
<mask token>

<mask token>


def test_internal_socket():
    client_socket, agent_socket = make_internal_socket()
    assert client_socket.read() is None
    assert agent_socket.read() is None
    client_socket.send('foo')
    assert agent_socket.read() == 'foo'
    assert agent_socket.read() is None
    agent_socket.send('foo')
    assert client_socket.read() == 'foo'
    assert client_socket.read() is None

from pandamonium.sockets import make_internal_socket


def test_internal_socket():
    client_socket, agent_socket = make_internal_socket()
    assert client_socket.read() is None
    assert agent_socket.read() is None
    client_socket.send('foo')
    assert agent_socket.read() == 'foo'
    assert agent_socket.read() is None
    agent_socket.send('foo')
    assert client_socket.read() == 'foo'
    assert client_socket.read() is None
