Fix events set assertion method
This commit is contained in:
parent
d0eb897ab0
commit
8f3a4582bb
9 changed files with 18 additions and 18 deletions
|
@ -33,8 +33,8 @@ class TestIntra(TraceTestCase):
|
||||||
)
|
)
|
||||||
|
|
||||||
def test_all(self):
|
def test_all(self):
|
||||||
# Check events order as set (e.g. node_init before pub_init)
|
# Check events as set
|
||||||
self.assertEventsOrderSet(self._events_ros)
|
self.assertEventsSet(self._events_ros)
|
||||||
|
|
||||||
# Check sub_init
|
# Check sub_init
|
||||||
sub_init_events = self.get_events_with_name('ros2:rcl_subscription_init')
|
sub_init_events = self.get_events_with_name('ros2:rcl_subscription_init')
|
||||||
|
|
|
@ -34,8 +34,8 @@ class TestNode(TraceTestCase):
|
||||||
)
|
)
|
||||||
|
|
||||||
def test_all(self):
|
def test_all(self):
|
||||||
# Check events order as set (e.g. init before node_init)
|
# Check events as set
|
||||||
self.assertEventsOrderSet(self._events_ros)
|
self.assertEventsSet(self._events_ros)
|
||||||
|
|
||||||
# Check fields
|
# Check fields
|
||||||
rcl_init_events = self.get_events_with_name('ros2:rcl_init')
|
rcl_init_events = self.get_events_with_name('ros2:rcl_init')
|
||||||
|
|
|
@ -31,8 +31,8 @@ class TestPublisher(TraceTestCase):
|
||||||
)
|
)
|
||||||
|
|
||||||
def test_all(self):
|
def test_all(self):
|
||||||
# Check events order as set (e.g. node_init before pub_init)
|
# Check events as set
|
||||||
self.assertEventsOrderSet(self._events_ros)
|
self.assertEventsSet(self._events_ros)
|
||||||
|
|
||||||
# Check fields
|
# Check fields
|
||||||
pub_init_events = self.get_events_with_name('ros2:rcl_publisher_init')
|
pub_init_events = self.get_events_with_name('ros2:rcl_publisher_init')
|
||||||
|
|
|
@ -32,8 +32,8 @@ class TestService(TraceTestCase):
|
||||||
)
|
)
|
||||||
|
|
||||||
def test_all(self):
|
def test_all(self):
|
||||||
# Check events order as set (e.g. service_init before callback_added)
|
# Check events as set
|
||||||
self.assertEventsOrderSet(self._events_ros)
|
self.assertEventsSet(self._events_ros)
|
||||||
|
|
||||||
# Check fields
|
# Check fields
|
||||||
srv_init_events = self.get_events_with_name('ros2:rcl_service_init')
|
srv_init_events = self.get_events_with_name('ros2:rcl_service_init')
|
||||||
|
|
|
@ -31,8 +31,8 @@ class TestServiceCallback(TraceTestCase):
|
||||||
)
|
)
|
||||||
|
|
||||||
def test_all(self):
|
def test_all(self):
|
||||||
# Check events order as set (e.g. start before end)
|
# Check events as set
|
||||||
self.assertEventsOrderSet(self._events_ros)
|
self.assertEventsSet(self._events_ros)
|
||||||
|
|
||||||
# Check fields
|
# Check fields
|
||||||
start_events = self.get_events_with_name('ros2:callback_start')
|
start_events = self.get_events_with_name('ros2:callback_start')
|
||||||
|
|
|
@ -32,8 +32,8 @@ class TestSubscription(TraceTestCase):
|
||||||
)
|
)
|
||||||
|
|
||||||
def test_all(self):
|
def test_all(self):
|
||||||
# Check events order as set (e.g. sub_init before callback_added)
|
# Check events as set
|
||||||
self.assertEventsOrderSet(self._events_ros)
|
self.assertEventsSet(self._events_ros)
|
||||||
|
|
||||||
# Check fields
|
# Check fields
|
||||||
sub_init_events = self.get_events_with_name('ros2:rcl_subscription_init')
|
sub_init_events = self.get_events_with_name('ros2:rcl_subscription_init')
|
||||||
|
|
|
@ -31,8 +31,8 @@ class TestSubscriptionCallback(TraceTestCase):
|
||||||
)
|
)
|
||||||
|
|
||||||
def test_all(self):
|
def test_all(self):
|
||||||
# Check events order as set (e.g. start before end)
|
# Check events as set
|
||||||
self.assertEventsOrderSet(self._events_ros)
|
self.assertEventsSet(self._events_ros)
|
||||||
|
|
||||||
# Check fields
|
# Check fields
|
||||||
start_events = self.get_events_with_name('ros2:callback_start')
|
start_events = self.get_events_with_name('ros2:callback_start')
|
||||||
|
|
|
@ -33,8 +33,8 @@ class TestTimer(TraceTestCase):
|
||||||
)
|
)
|
||||||
|
|
||||||
def test_all(self):
|
def test_all(self):
|
||||||
# Check events order as set (e.g. init, callback added, start, end)
|
# Check events as set
|
||||||
self.assertEventsOrderSet(self._events_ros)
|
self.assertEventsSet(self._events_ros)
|
||||||
|
|
||||||
# Check fields
|
# Check fields
|
||||||
init_events = self.get_events_with_name('ros2:rcl_timer_init')
|
init_events = self.get_events_with_name('ros2:rcl_timer_init')
|
||||||
|
|
|
@ -99,13 +99,13 @@ class TraceTestCase(unittest.TestCase):
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
cleanup_trace(self._full_path)
|
cleanup_trace(self._full_path)
|
||||||
|
|
||||||
def assertEventsOrderSet(self, event_names: List[str]):
|
def assertEventsSet(self, event_names: List[str]):
|
||||||
"""
|
"""
|
||||||
Compare given event names to trace events names as sets.
|
Compare given event names to trace events names as sets.
|
||||||
|
|
||||||
:param event_names: the list of event names to compare to (as a set)
|
:param event_names: the list of event names to compare to (as a set)
|
||||||
"""
|
"""
|
||||||
self.assertSetEqual(set(self._event_names), set(event_names), 'wrong events order')
|
self.assertSetEqual(set(self._event_names), set(event_names), 'wrong events')
|
||||||
|
|
||||||
def assertProcessNamesExist(self, names: List[str]):
|
def assertProcessNamesExist(self, names: List[str]):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue