grasp_synergy_test.py
Go to the documentation of this file.
00001 #!/usr/bin/env python
00002 import rostest
00003 import unittest
00004 import rospy
00005 
00006 class SynergySelfCheck(unittest.TestCase):
00007     """
00008     Very basic self-test capabilities.
00009 
00010     NOTE: currently these aren't run because of deadlock problems in creating
00011     the topic subscribers.
00012 
00013     """
00014 
00015     def setUp(self):
00016         # Wait for topics
00017         self.topic_dict = {}
00018         while '/test_synergy/grasp_synergy' not in self.topic_dict:
00019             _, _, topic_types = rospy.get_master().getTopicTypes()
00020             self.topic_dict = dict(topic_types)
00021             print self.topic_dict
00022 
00023             rospy.sleep(0.02)
00024         rospy.sleep(0.1)
00025 
00026     def sleepingtest_topics(self):  # NOTE These tests currently do not run.
00027         # Make sure we have the right number of topics in the appropriate
00028         # test_synergy namespace.
00029         self.assertIn('/test_synergy/grasp_synergy', self.topic_dict)
00030         self.assertIn('/test_synergy/grasp_synergy/syn_0', self.topic_dict)
00031         self.assertIn('/test_synergy/grasp_synergy/syn_1', self.topic_dict)
00032         self.assertIn('/test_synergy/grasp_synergy/syn_2', self.topic_dict)
00033         self.assertNotIn('/test_synergy/grasp_synergy/syn_3', self.topic_dict)
00034 
00035 
00036 
00037 if __name__ == '__main__':
00038     import rostest
00039     rospy.init_node('grasp_synergy_test')
00040     rostest.rosrun('grasp_synergy', 'grasp_synergy_test', SynergySelfCheck)


grasp-synergy
Author(s): Felix Duvallet
autogenerated on Sat Jun 8 2019 20:11:26