projects
/
babeltrace.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
bt2: Add remaining trace-ir `*Const` classes and adapt tests
[babeltrace.git]
/
tests
/
bindings
/
python
/
bt2
/
test_clock_class.py
diff --git
a/tests/bindings/python/bt2/test_clock_class.py
b/tests/bindings/python/bt2/test_clock_class.py
index 5788e80cb1cc77a46fb159d22563843b2f551093..f630c3371df9e412c6a561daae9359ce58cd493d 100644
(file)
--- a/
tests/bindings/python/bt2/test_clock_class.py
+++ b/
tests/bindings/python/bt2/test_clock_class.py
@@
-19,7
+19,10
@@
import unittest
import uuid
import bt2
import unittest
import uuid
import bt2
+import utils
from utils import run_in_component_init, TestOutputPortMessageIterator
from utils import run_in_component_init, TestOutputPortMessageIterator
+from bt2 import value as bt2_value
+from bt2 import clock_class as bt2_clock_class
class ClockClassOffsetTestCase(unittest.TestCase):
class ClockClassOffsetTestCase(unittest.TestCase):
@@
-205,6
+208,7
@@
class ClockClassTestCase(unittest.TestCase):
cc = run_in_component_init(f)
self.assertEqual(cc.user_attributes, {'salut': 23})
cc = run_in_component_init(f)
self.assertEqual(cc.user_attributes, {'salut': 23})
+ self.assertIs(type(cc.user_attributes), bt2_value.MapValue)
def test_create_invalid_user_attributes(self):
def f(comp_self):
def test_create_invalid_user_attributes(self):
def f(comp_self):
@@
-218,6
+222,10
@@
class ClockClassTestCase(unittest.TestCase):
self.assertRaisesInComponentInit(TypeError, f)
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):
class ClockSnapshotTestCase(unittest.TestCase):
def setUp(self):
@@
-285,9
+293,9
@@
class ClockSnapshotTestCase(unittest.TestCase):
self.assertEqual(self._msg.default_clock_snapshot.value, 123)
def test_clock_class(self):
self.assertEqual(self._msg.default_clock_snapshot.value, 123)
def test_clock_class(self):
- self.assertEqual(
- self._msg.default_clock_snapshot.clock_class.addr, self._cc.addr
- )
+ cc = self._msg.default_clock_snapshot.clock_class
+ self.assertEqual(cc.addr, self._cc.addr)
+
self.assertIs(type(cc), bt2_clock_class._ClockClassConst
)
def test_ns_from_origin(self):
s_from_origin = 45 + ((354 + 123) / 1000)
def test_ns_from_origin(self):
s_from_origin = 45 + ((354 + 123) / 1000)
This page took
0.027239 seconds
and
4
git commands to generate.