def test_channel_passes_send_on_to_four_sockets(): mk(('echo.sock', 'channel.send(channel.recv())')) channel = Channel('foo', ThreadedBuffer) sockets = [make_socket(channel=channel) for i in range(4)] channel.send('foo') for socket in sockets: expected = deque([Message.from_bytes('3::/echo.sock:foo')]) actual = socket.outgoing.queue assert actual == expected, actual
def test_channel_passes_send_on_to_four_sockets(mk): mk(('echo.sock.spt', 'channel.send(channel.recv())')) channel = Channel('foo', ThreadedBuffer) sockets = [make_socket(channel=channel) for i in range(4)] channel.send('foo') for socket in sockets: expected = deque([Message.from_bytes('3::/echo.sock:foo')]) actual = socket.outgoing.queue assert actual == expected
def test_channel_passes_send_on_to_one_socket(): mk(('echo.sock', '')) socket = make_socket() channel = Channel('foo', ThreadedBuffer) channel.add(socket) channel.send('foo') expected = deque([Message.from_bytes('3::/echo.sock:foo')]) actual = socket.outgoing.queue assert actual == expected, actual
def test_channel_passes_send_on_to_one_socket(mk): mk(('echo.sock.spt', '')) socket = make_socket() channel = Channel('foo', ThreadedBuffer) channel.add(socket) channel.send('foo') expected = deque([Message.from_bytes('3::/echo.sock:foo')]) actual = socket.outgoing.queue assert actual == expected