- def test_no_clock_value(self):
- msg = self._create_test_event_message(with_clockclass=False)
- self.assertIsNone(msg.default_clock_snapshot)
+ def test_clock_value(self):
+ msg = utils.get_event_message()
+ self.assertEqual(msg.default_clock_snapshot.value, 789)
+ self.assertIs(
+ type(msg.default_clock_snapshot), bt2_clock_snapshot._ClockSnapshotConst
+ )
+
+ def test_const_no_clock_value(self):
+ msg = self._create_test_const_event_message(with_clockclass=False)
+ with self.assertRaisesRegex(
+ ValueError, 'stream class has no default clock class'
+ ):
+ msg.default_clock_snapshot
+
+ def test_const_stream(self):
+ msg = self._create_test_const_event_message()
+ self.assertEqual(msg.event.stream.addr, self.stream.addr)
+ self.assertIs(type(msg.event.stream), bt2_stream._StreamConst)