def test_straightforward(self): try: server_transport = ZeroRPCServerTransport.create_tcp(8192) server = SyncServer(transport=server_transport, service=FooService()) server.bind() client_transport = ZeroRPCClientTransport.create_tcp(8192) client = Client(client_transport) self.assertEqual(client.foo(), 42) finally: server.unbind()
def test_straightforward(self): with async_server_context(FooService()) as server: client_transport = ZeroRPCClientTransport.create_tcp(8192) client = Client(client_transport) self.assertEqual(client.foo(), 42) self.assertFalse(server.has_deferred_requests())