Example #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()
Example #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
Example #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
Example #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()
Example #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)
Example #6
0
 def setup(self):
     self.conn = rpyc.connect_thread(remote_service=MyService)
Example #7
0
 def setUp(self):
     self.conn = rpyc.connect_thread(remote_service=MyService)
     self.conn.root.reset()
Example #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))

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