lib: pass config object to message iterator init method, add can seek forward property
[babeltrace.git] / tests / bindings / python / bt2 / test_clock_class.py
index 208e8b29f253eec99797e31bf6727b664c1316ef..c4b34bd29b14110f7674873177600e4db523f085 100644 (file)
@@ -19,6 +19,7 @@
 import unittest
 import uuid
 import bt2
+import utils
 from utils import run_in_component_init, TestOutputPortMessageIterator
 from bt2 import value as bt2_value
 from bt2 import clock_class as bt2_clock_class
@@ -221,6 +222,10 @@ class ClockClassTestCase(unittest.TestCase):
 
         self.assertRaisesInComponentInit(TypeError, f)
 
+    def test_const_user_attributes(self):
+        cc = utils.get_const_event_message().default_clock_snapshot.clock_class
+        self.assertIs(type(cc.user_attributes), bt2_value._MapValueConst)
+
 
 class ClockSnapshotTestCase(unittest.TestCase):
     def setUp(self):
@@ -242,7 +247,7 @@ class ClockSnapshotTestCase(unittest.TestCase):
         self._cc = _cc
 
         class MyIter(bt2._UserMessageIterator):
-            def __init__(self, self_port_output):
+            def __init__(self, config, self_port_output):
                 self._at = 0
 
             def __next__(self):
@@ -261,7 +266,7 @@ class ClockSnapshotTestCase(unittest.TestCase):
                 return notif
 
         class MySrc(bt2._UserSourceComponent, message_iterator_class=MyIter):
-            def __init__(self, params, obj):
+            def __init__(self, config, params, obj):
                 self._add_output_port('out')
 
         self._graph = bt2.Graph()
@@ -321,3 +326,7 @@ class ClockSnapshotTestCase(unittest.TestCase):
 
         self.assertTrue(self._msg.default_clock_snapshot <= 123)
         self.assertFalse(self._msg.default_clock_snapshot <= 100)
+
+
+if __name__ == '__main__':
+    unittest.main()
This page took 0.02398 seconds and 4 git commands to generate.