def test_instancecheck_list(self): service = MyService() conn = rpyc.connect_thread(remote_service=service) conn.root remote_list = conn.root.getlist() self.assertTrue(conn.root.instance(remote_list, list)) conn.close()
def setUp(self): global on_connect_called self.conn = rpyc.connect_thread(remote_service=MyService) self.conn.root # this will block until the service is initialized, # so we can be sure on_connect_called is True by that time self.assertTrue(on_connect_called) on_connect_called = False
def test_instancecheck_none(self): """ test for the regression reported in https://github.com/tomerfiliba-org/rpyc/issues/426 """ service = MyService() conn = rpyc.connect_thread(remote_service=service) remote_NoneType = conn.root.getnonetype() self.assertTrue(isinstance(None, remote_NoneType)) conn.close()
def setUp(self): self.service = MyService() client_config = { "before_closed": before_closed, "close_catchall": False } self.conn = rpyc.connect_thread(remote_service=self.service, config=client_config) self.conn.root # this will block until the service is initialized, # so we can be sure on_connect_called is True by that time self.assertTrue(self.service.on_connect_called)
def setup(self): self.conn = rpyc.connect_thread(remote_service=MyService)
def setUp(self): self.conn = rpyc.connect_thread(remote_service=MyService) self.conn.root.reset()
import rpyc class AService(rpyc.Service): class exposed_A(object): @classmethod def exposed_foo(cls, a, b): return 17 * a + b if __name__ == "__main__": with rpyc.connect_thread(remote_service = AService) as conn: print( conn.root.A.foo(1, 2))
def setup(self): self.conn = rpyc.connect_thread(remote_service=MyService) self.conn.root # this will block until the service is initialized, # so we can be sure on_connect_called is True by that time assert on_connect_called
def setup(self): self.conn = rpyc.connect_thread(remote_service=MyService) self.bgserver = rpyc.BgServingThread(self.conn)
def setUp(self): self.conn = rpyc.connect_thread(remote_service=MyService) self.bgserver = rpyc.BgServingThread(self.conn)
def setUp(self): self.conn = rpyc.connect_thread(remote_service=MyService) self.conn.root # this will block until the service is initialized,
def setUp(self): self.service = MyService() self.conn = rpyc.connect_thread(remote_service=self.service)