Exemplo n.º 1
0
 def test_ask_is_published_on_topic(self):
     time.sleep(
         3)  #infochan node subscribers may be not registered in master
     self.infochan_Ask_subscriber_topic.publish(testMessages.getValidAsk())
     timeout_t = time.time() + 60.0
     while not rospy.is_shutdown(
     ) and not self._infochan_published_ask_success and time.time(
     ) < timeout_t:
         time.sleep(0.1)
     self.assert_(self._infochan_published_ask_success)
Exemplo n.º 2
0
    def test_sign_ask(self):
        rospy.Subscriber('/lighthouse/infochan/eth/sending/demand', Demand,
                         self.signed_ask_handler)
        askPublisherTest = rospy.Publisher(
            '/lighthouse/infochan/eth/signing/demand', Demand, queue_size=10)

        time.sleep(
            3
        )  #because signer node subscribers may be not registered in master
        askPublisherTest.publish(testMessages.getValidAsk())
        timeout_t = time.time() + 60.0
        while not rospy.is_shutdown(
        ) and not self._test_sign_ask_success and time.time() < timeout_t:
            time.sleep(0.1)
        self.assert_(self._test_sign_ask_success)
Exemplo n.º 3
0
 def infochan_published_ask_handler(self, ask):
     self.assertEqual(testMessages.getValidAsk(), ask)
     self._infochan_published_ask_success = True
Exemplo n.º 4
0
 def test_ask2dict(self):
     self.assertEqual(testMessages.validAskDict,
                      ipfs_channel.ask2dict(testMessages.getValidAsk()))