'messages are sent and received properly'

def test_basic(self):

    question = 'sucess?'
    answer = 'yeah,    success'
    def handler(sock):
        text = sock.recv(1000)
        assert (text == question)
        sock.sendall(answer)
    with Server(handler) as (host, port):
        sock = socket.socket()
        sock.connect((host, port))
        sock.sendall(question)
        text = sock.recv(1000)
        assert (text == answer)
        sock.close()
