@@ -37,14 +37,14 @@ def tearDown(self) -> None:
3737 self .executor .shutdown ()
3838 rclpy .shutdown ()
3939
40- def assertTopicSubscribed (self , topic : str , timeout : float = 1.0 ) -> None :
40+ def assert_topic_subscribed (self , topic : str , timeout : float = 1.0 ) -> None :
4141 start_time = time .monotonic ()
4242 while not is_topic_subscribed (self .node , topic ):
4343 time .sleep (0.05 )
4444 if time .monotonic () - start_time > timeout :
4545 self .fail (f"Timed out waiting for topic '{ topic } ' to be subscribed." )
4646
47- def assertTopicNotSubscribed (self , topic : str , timeout : float = 1.0 ) -> None :
47+ def assert_topic_not_subscribed (self , topic : str , timeout : float = 1.0 ) -> None :
4848 start_time = time .monotonic ()
4949 while is_topic_subscribed (self .node , topic ):
5050 time .sleep (0.05 )
@@ -56,22 +56,22 @@ def test_register_multisubscriber(self) -> None:
5656 topic = "/test_register_multisubscriber"
5757 msg_type = "std_msgs/String"
5858
59- self .assertTopicNotSubscribed (topic )
59+ self .assert_topic_not_subscribed (topic )
6060 MultiSubscriber (topic , self .client_id , lambda * _args : None , self .node , msg_type = msg_type )
61- self .assertTopicSubscribed (topic )
61+ self .assert_topic_subscribed (topic )
6262
6363 def test_unregister_multisubscriber (self ) -> None :
6464 """Register and unregister a subscriber on a clean topic with a good msg type."""
6565 topic = "/test_unregister_multisubscriber"
6666 msg_type = "std_msgs/String"
6767
68- self .assertTopicNotSubscribed (topic )
68+ self .assert_topic_not_subscribed (topic )
6969 multi : MultiSubscriber [String ] = MultiSubscriber (
7070 topic , self .client_id , lambda * _args : None , self .node , msg_type = msg_type
7171 )
72- self .assertTopicSubscribed (topic )
72+ self .assert_topic_subscribed (topic )
7373 multi .unregister ()
74- self .assertTopicNotSubscribed (topic )
74+ self .assert_topic_not_subscribed (topic )
7575
7676 def test_verify_type (self ) -> None :
7777 topic = "/test_verify_type"
@@ -101,11 +101,11 @@ def test_subscribe_unsubscribe(self) -> None:
101101 topic = "/test_subscribe_unsubscribe"
102102 msg_type = "std_msgs/String"
103103
104- self .assertTopicNotSubscribed (topic )
104+ self .assert_topic_not_subscribed (topic )
105105 multi : MultiSubscriber [String ] = MultiSubscriber (
106106 topic , self .client_id , lambda * _args : None , self .node , msg_type = msg_type
107107 )
108- self .assertTopicSubscribed (topic )
108+ self .assert_topic_subscribed (topic )
109109 self .assertEqual (len (multi .new_subscriptions ), 0 )
110110
111111 multi .subscribe (self .client_id , lambda _ : None )
@@ -115,7 +115,7 @@ def test_subscribe_unsubscribe(self) -> None:
115115 self .assertEqual (len (multi .new_subscriptions ), 0 )
116116
117117 multi .unregister ()
118- self .assertTopicNotSubscribed (topic )
118+ self .assert_topic_not_subscribed (topic )
119119
120120 def test_subscribe_receive_json (self ) -> None :
121121 topic = "/test_subscribe_receive_json"
0 commit comments