Update style for test_subscription_callback
This commit is contained in:
parent
a5739a099c
commit
bb509e672c
1 changed files with 6 additions and 4 deletions
|
@ -42,14 +42,14 @@ class TestSubscriptionCallback(TraceTestCase):
|
||||||
self.assertIsInstance(is_intra_process_value, int, 'is_intra_process not int')
|
self.assertIsInstance(is_intra_process_value, int, 'is_intra_process not int')
|
||||||
self.assertTrue(
|
self.assertTrue(
|
||||||
is_intra_process_value in [0, 1],
|
is_intra_process_value in [0, 1],
|
||||||
f'invalid value for is_intra_process: {is_intra_process_value}')
|
f'invalid value for is_intra_process: {is_intra_process_value}',
|
||||||
|
)
|
||||||
|
|
||||||
end_events = self.get_events_with_name('ros2:callback_end')
|
end_events = self.get_events_with_name('ros2:callback_end')
|
||||||
for event in end_events:
|
for event in end_events:
|
||||||
self.assertValidHandle(event, 'callback')
|
self.assertValidHandle(event, 'callback')
|
||||||
|
|
||||||
# Check that a start:end pair has a common callback handle
|
# Check that a start:end pair has a common callback handle
|
||||||
# Note: might be unstable if tracing is disabled too early
|
|
||||||
ping_events = self.get_events_with_procname('test_ping')
|
ping_events = self.get_events_with_procname('test_ping')
|
||||||
pong_events = self.get_events_with_procname('test_pong')
|
pong_events = self.get_events_with_procname('test_pong')
|
||||||
ping_events_start = self.get_events_with_name('ros2:callback_start', ping_events)
|
ping_events_start = self.get_events_with_name('ros2:callback_start', ping_events)
|
||||||
|
@ -59,13 +59,15 @@ class TestSubscriptionCallback(TraceTestCase):
|
||||||
ping_start,
|
ping_start,
|
||||||
'callback',
|
'callback',
|
||||||
'ros2:callback_end',
|
'ros2:callback_end',
|
||||||
ping_events)
|
ping_events,
|
||||||
|
)
|
||||||
for pong_start in pong_events_start:
|
for pong_start in pong_events_start:
|
||||||
self.assertMatchingField(
|
self.assertMatchingField(
|
||||||
pong_start,
|
pong_start,
|
||||||
'callback',
|
'callback',
|
||||||
'ros2:callback_end',
|
'ros2:callback_end',
|
||||||
pong_events)
|
pong_events,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue