bt2: pass custom Python object to Python component's __init__()
[babeltrace.git] / tests / data / plugins / flt.utils.trimmer / bt_plugin_trimmer_test.py
index 140dd54c50752c411e0cfc2a500790b9b38abf81..c7d5985dffd001143305621121f53ed73a91d2c9 100644 (file)
@@ -33,7 +33,7 @@ class TheIteratorOfAllEvil(bt2._UserMessageIterator):
         ]
         self._at = 0
 
-    def _seek_beginning(self):
+    def _user_seek_beginning(self):
         self._at = 0
 
     def __next__(self):
@@ -44,19 +44,24 @@ class TheIteratorOfAllEvil(bt2._UserMessageIterator):
         else:
             raise StopIteration
 
+
 @bt2.plugin_component_class
-class TheSourceOfAllEvil(bt2._UserSourceComponent,
-        message_iterator_class=TheIteratorOfAllEvil):
-    def __init__(self, params):
+class TheSourceOfAllEvil(
+    bt2._UserSourceComponent, message_iterator_class=TheIteratorOfAllEvil
+):
+    def __init__(self, params, obj):
         tc = self._create_trace_class()
 
         # Use a clock class with an offset, so we can test with --begin or --end
         # smaller than this offset (in other words, a time that it's not
         # possible to represent with this clock class).
         cc = self._create_clock_class(frequency=1, offset=bt2.ClockClassOffset(10000))
-        sc = tc.create_stream_class(default_clock_class=cc,
-                                    packets_have_beginning_default_clock_snapshot=True,
-                                    packets_have_end_default_clock_snapshot=True)
+        sc = tc.create_stream_class(
+            default_clock_class=cc,
+            supports_packets=True,
+            packets_have_beginning_default_clock_snapshot=True,
+            packets_have_end_default_clock_snapshot=True,
+        )
         ec1 = sc.create_event_class(name='event 1')
         ec2 = sc.create_event_class(name='event 2')
         self._add_output_port('out', (tc, sc, ec1, ec2, params))
This page took 0.028751 seconds and 4 git commands to generate.