Exemplo n.º 1
0
 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()
Exemplo n.º 2
0
 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
Exemplo n.º 3
0
 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
Exemplo n.º 4
0
 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()
Exemplo n.º 5
0
    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)
Exemplo n.º 6
0
 def setup(self):
     self.conn = rpyc.connect_thread(remote_service=MyService)
Exemplo n.º 7
0
 def setUp(self):
     self.conn = rpyc.connect_thread(remote_service=MyService)
     self.conn.root.reset()
Exemplo n.º 8
0
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))

Exemplo n.º 9
0
 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
Exemplo n.º 10
0
 def setup(self):
     self.conn = rpyc.connect_thread(remote_service=MyService)
     self.bgserver = rpyc.BgServingThread(self.conn)
Exemplo n.º 11
0
 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
Exemplo n.º 12
0
 def setUp(self):
     self.conn = rpyc.connect_thread(remote_service=MyService)
     self.bgserver = rpyc.BgServingThread(self.conn)
Exemplo n.º 13
0
 def setUp(self):
     self.conn = rpyc.connect_thread(remote_service=MyService)
     self.conn.root # this will block until the service is initialized,
Exemplo n.º 14
0
 def setUp(self):
     self.service = MyService()
     self.conn = rpyc.connect_thread(remote_service=self.service)