Beispiel #1
0
 def setUp(self):
     context = Context()
     self.factory = ChatFactory()
     server = makeTCPServer(context,
                            Chat,
                            self.factory,
                            installProtocol=False)
     self.client1 = (yield makeTCPClient(context, ClientProtocol,
                                         server)).clientProtocol
     self.client2 = (yield makeTCPClient(context, ClientProtocol,
                                         server)).clientProtocol
     self.addCleanup(context.cleanup)
Beispiel #2
0
 def setUp(self):
     context = Context()
     server = makeTCPServer(context, ServerProtocol)
     client = yield makeTCPClient(context, EchoClient, server)
     hook(EchoClient, 'lineReceived')
     self.client = client.clientProtocol
     self.server = client.serverProtocol
     self.addCleanup(context.cleanup)
 def setUp(self):
     context = Context()
     server = makeTCPServer(context, EchoServer)
     client = yield makeTCPClient(context, ClientProtocol, server)
     self.client = client.clientProtocol
     self.addCleanup(context.cleanup)
 def testConnectDisconnect(self):
     context = Context()
     server = makeTCPServer(context, EchoServer)
     client = yield makeTCPClient(context, ClientProtocol, server)
     self.client = client.clientProtocol
     yield context.cleanup()