Ejemplo n.º 1
0
    def test_call_later(self):
        node = Node("TestNode2")

        def callback():
            self.assertTrue(True)
            node.stop()

        node.add_delayed_callback(100, callback)
        node.start()
        self.assertTrue(True)
Ejemplo n.º 2
0
 def __init__(self, name):
     Node.__init__(self, name)
     self.publisher = self.add_publisher("proto.pub.topic")
     self.repeater = self.add_repeater(1000, self.callback)
     self.count = 0
Ejemplo n.º 3
0
 def __init__(self, name):
     Node.__init__(self, name)
     self.reply_server = self.add_reply_server("rpc.topic",
                                               self.request_callback)
Ejemplo n.º 4
0
 def __init__(self, name):
     Node.__init__(self, name)
     self.request_client = self.add_request_client("rpc.topic",
                                                   self.connect_handler)
     # self.repeater = self.add_repeater(1000, self.request_sender)
     self.counter = 0
Ejemplo n.º 5
0
 def test_start_stop(self):
     node = Node("TestNode")
     self.assertIsNotNone(node.logger)
     node.loop.call_later(0.2, node.stop)
     node.start()
     self.assertTrue(True)