5 from dynamic_reconfigure.client
import Client
8 from std_msgs.msg
import String
21 sub_out = rospy.Subscriber(
"/stealth_relay/output", String,
24 if sub_out.get_num_connections() == 0:
26 self.assertTrue(sub_out.get_num_connections() > 0,
27 "output topic of stealth relay was not advertised")
31 "stealth relay node published message unexpectedly.")
33 sub_monitor = rospy.Subscriber(
"/original_topic/relay", String,
35 rospy.loginfo(
"subscribed monitor topic")
38 sub_monitor.unregister()
39 rospy.loginfo(
"unsubscribed monitor topic")
42 "monitoring topic is not published")
44 "output topic of stealth relay was not published even monitoring topic is published")
47 "It seems stealth relay node did not stop subscribing even if monitoring topic is not published any more")
59 if __name__ ==
'__main__':
61 rospy.init_node(
"test_stealth_relay")
62 rostest.rosrun(
"jsk_topic_tools",
"test_stealth_relay", TestStealthRelay)
def test_stealth_relay(self)
def monitor_callback(self, msg)
def out_callback(self, msg)