X-Git-Url: https://git.efficios.com/?a=blobdiff_plain;f=tests%2Fbindings%2Fpython%2Fbt2%2Ftest_trace_collection_message_iterator.py;h=f3b337639a17322da7128c71aac4bc944d307ea3;hb=61d96b89a9c8b3b523558a3c007c2aaedaba2a55;hp=e804a4f232ab2fa6b3a62f063a779eaa4178e7f4;hpb=1eda2e7260a750e6cce4bf89ba09681510663ae9;p=babeltrace.git diff --git a/tests/bindings/python/bt2/test_trace_collection_message_iterator.py b/tests/bindings/python/bt2/test_trace_collection_message_iterator.py index e804a4f2..f3b33763 100644 --- a/tests/bindings/python/bt2/test_trace_collection_message_iterator.py +++ b/tests/bindings/python/bt2/test_trace_collection_message_iterator.py @@ -24,9 +24,9 @@ import os.path _BT_CTF_TRACES_PATH = os.environ['BT_CTF_TRACES_PATH'] -_3EVENTS_INTERSECT_TRACE_PATH = os.path.join(_BT_CTF_TRACES_PATH, - 'intersection', - '3eventsintersect') +_3EVENTS_INTERSECT_TRACE_PATH = os.path.join( + _BT_CTF_TRACES_PATH, 'intersection', '3eventsintersect' +) class ComponentSpecTestCase(unittest.TestCase): @@ -55,6 +55,7 @@ class ComponentSpecTestCase(unittest.TestCase): # Return a map, msg type -> number of messages of this type. + def _count_msgs_by_type(msgs): res = {} @@ -126,16 +127,16 @@ class TraceCollectionMessageIteratorTestCase(unittest.TestCase): def test_iter_custom_filter(self): src_spec = bt2.ComponentSpec('ctf', 'fs', _3EVENTS_INTERSECT_TRACE_PATH) - flt_spec = bt2.ComponentSpec('utils', 'trimmer', { - 'end': '13515309.000000075', - }) + flt_spec = bt2.ComponentSpec('utils', 'trimmer', {'end': '13515309.000000075'}) msg_iter = bt2.TraceCollectionMessageIterator(src_spec, flt_spec) hist = _count_msgs_by_type(msg_iter) self.assertEqual(hist[bt2.message._EventMessage], 5) def test_iter_intersection(self): specs = [bt2.ComponentSpec('ctf', 'fs', _3EVENTS_INTERSECT_TRACE_PATH)] - msg_iter = bt2.TraceCollectionMessageIterator(specs, stream_intersection_mode=True) + msg_iter = bt2.TraceCollectionMessageIterator( + specs, stream_intersection_mode=True + ) msgs = list(msg_iter) self.assertEqual(len(msgs), 15) hist = _count_msgs_by_type(msgs)