def testServerAndPlayerIntegration(): host, port = 'localhost', 5000 server = RequestServer((host, port), player=LocalPlayer(), handler_class=YamRequestHandler) server.start() client = RemoteClient(host, port) client.sendRequest('player;getState') server.stop()
def testClientAndServer(): host, port = 'localhost', 5000 server = RequestServer((host, port), handler_class=EchoRequestHandler) server.start() client = RemoteClient(host, port) client.sendRequest('HELLO WORLD') import time time.sleep(1) client.sendRequest('Second message') server.stop() return 0