Exemplo n.º 1
0
 def test_bid_is_published_on_topic(self):
     time.sleep(3) #infochan node subscribers may be not registered in master
     self.infochan_Bid_subscriber_topic.publish(testMessages.getValidBid())
     timeout_t = time.time() + 60.0
     while not rospy.is_shutdown() and not self._infochan_published_bid_success and time.time() < timeout_t:
         time.sleep(0.1)
     self.assert_(self._infochan_published_bid_success)
Exemplo n.º 2
0
    def test_sign_bid(self):
        rospy.Subscriber('/liability/infochan/eth/sending/offer', Offer,
                         self.signed_bid_handler)
        bidPublisherTest = rospy.Publisher(
            '/liability/infochan/eth/signing/offer', Offer, queue_size=10)

        time.sleep(
            3
        )  #because signer node subscribers may be not registered in master
        bidPublisherTest.publish(testMessages.getValidBid())
        timeout_t = time.time() + 60.0
        while not rospy.is_shutdown(
        ) and not self._test_sign_bid_success and time.time() < timeout_t:
            time.sleep(0.1)
        self.assert_(self._test_sign_bid_success)
Exemplo n.º 3
0
 def infochan_published_bid_handler(self, bid):
     self.assertEqual(testMessages.getValidBid(), bid)
     self._infochan_published_bid_success = True
Exemplo n.º 4
0
 def test_bid2dict(self):
     self.assertEqual(testMessages.validBidDict, ipfs_channel.bid2dict(testMessages.getValidBid()))
Exemplo n.º 5
0
 def test_offer2dict(self):
     self.assertEqual(testMessages.validBidDict,
                      offer2dict(testMessages.getValidBid()))