36 roslib.load_manifest(
'rosbag')
52 cmd = [
'rosbag',
'info',
53 '/tmp/test_rosbag_record_one_publisher_two_topics.bag',
55 p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
56 out,err = p.communicate()
58 for l
in out.decode().split(
'\n'):
59 f = l.strip().split(
': ')
60 if len(f) == 2
and f[0] ==
'- topic':
63 self.assertEqual(topic_count, 2)
65 if __name__ ==
'__main__':
66 rostest.unitrun(
'test_rosbag',
'topic_count', TopicCount, sys.argv)
def test_topic_count(self)