def test_unsubscribe_all(self):
     PUBLISHER.subscribe(self._listener, RideTestMessageWithAttrs)
     PUBLISHER.subscribe(self._static_listener, RideTestMessageWithAttrs)
     PUBLISHER.subscribe(self._class_listener, RideTestMessageWithAttrs)
     msg_obj = RideTestMessageWithAttrs(foo='one', bar='two')
     msg_obj.publish()
     assert_equal(len(TestPublisher.cls_msgs), 3)
     PUBLISHER.unsubscribe_all(self)
     msg_obj.publish()
     assert_equal(len(TestPublisher.cls_msgs), 3)
 def test_unsubscribe_all_input_none(self):
     PUBLISHER.subscribe(self._listener, RideTestMessageWithAttrs)
     PUBLISHER.subscribe(self._static_listener, RideTestMessageWithAttrs)
     PUBLISHER.subscribe(self._class_listener, RideTestMessageWithAttrs)
     PUBLISHER.subscribe(_common_listener, RideTestMessageWithAttrs)
     dummy_obj = DummyClass()
     msg_obj = RideTestMessageWithAttrs(foo='one', bar='two')
     msg_obj.publish()
     assert_equal(len(TestPublisher.cls_msgs), 5)
     PUBLISHER.unsubscribe_all()
     msg_obj.publish()
     assert_equal(len(TestPublisher.cls_msgs), 5)
 def setUp(self):
     self._msg = ''
     TestPublisher.cls_msg = ''
     TestPublisher.cls_msgs.clear()
     PUBLISHER.unsubscribe_all()
     PUBLISHER._publisher.getTopicMgr().clearTree()