def test_peek(self):
    (server, client) = loopback()
    server.send(b'xy')
    for _ in range(2):
        output_buffer = bytearray(5)
        assert (client.recv_into(output_buffer, flags=MSG_PEEK) == 2)
        assert (output_buffer == bytearray(b'xy\x00\x00\x00'))
def test_peek(self):
    (server, client) = loopback()
    server.send(b'xy')
    for _ in range(2):
        output_buffer = bytearray(5)
        assert (client.recv_into(output_buffer, flags=MSG_PEEK) == 2)
        assert (output_buffer == bytearray(b'xy\x00\x00\x00'))