Пример #1
0
    def test_destroy(self):
        obj = pychirp.Object(ctypes.c_void_p())
        self.assertRaises(pychirp.Failure, lambda: obj.destroy())

        scheduler = pychirp.Scheduler()
        scheduler.destroy()
        self.assertRaises(pychirp.Failure, lambda: scheduler.destroy())
Пример #2
0
 def setUp(self):
     self.scheduler = pychirp.Scheduler()
     self.endpointA = pychirp.Leaf(self.scheduler)
     self.endpointB = pychirp.Leaf(self.scheduler)
     self.server = None
     self.server_connection = None
     self.client = None
     self.client_connection = None
     self.connect_handler_res = None
     self.accept_handler_res = None
     self.death_handler_res = None
Пример #3
0
 def setUp(self):
     self.scheduler = pychirp.Scheduler()
     self.endpointA = pychirp.Leaf(self.scheduler)
     self.endpointB = pychirp.Leaf(self.scheduler)
     self.timeout = 5.0
     self.identification = 'hello'
     self.client = pychirp.AutoConnectingTcpClient(self.endpointA,
                                                   self.ADDRESS, self.PORT,
                                                   self.timeout,
                                                   self.identification)
     self.server = None
     self.server_connection = None
     self.connect_handler_res = None
     self.connect_handler_connection = None
     self.disconnect_handler_res = None
Пример #4
0
 def test_init(self):
     obj = pychirp.Object(ctypes.c_void_p())
     scheduler = pychirp.Scheduler()
Пример #5
0
 def test_str(self):
     obj = pychirp.Object(ctypes.c_void_p())
     self.assertRegex(str(obj), r'.*Object.*INVALID.*')
     scheduler = pychirp.Scheduler()
     self.assertRegex(str(scheduler), r'.*Scheduler.*0x[0-9a-f]{8}.*')
Пример #6
0
 def setUp(self):
     self.scheduler = pychirp.Scheduler()
     self.leaf = pychirp.Leaf(self.scheduler)
Пример #7
0
 def setUp(self):
     self.scheduler = pychirp.Scheduler()
     self.node = pychirp.Node(self.scheduler)
Пример #8
0
 def setUp(self):
     self.scheduler = pychirp.Scheduler()
     self.endpointA = pychirp.Leaf(self.scheduler)
     self.endpointB = pychirp.Leaf(self.scheduler)
     self.connection = pychirp.LocalConnection(self.endpointA,
                                               self.endpointB)