X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=tests%2Fbindings%2Fpython%2Fbt2%2Ftest_stream_class.py;h=f68be98ddede8556dc687548c166c2456f5f318e;hb=aa7407227594c8e5ebff8e1944a902760f2c9a17;hp=9010dcd4c7d68e6755f26a8e7488358b6def47c2;hpb=5c72947e9bc82704d451e8f760b5171e374835e5;p=babeltrace.git diff --git a/tests/bindings/python/bt2/test_stream_class.py b/tests/bindings/python/bt2/test_stream_class.py index 9010dcd4..f68be98d 100644 --- a/tests/bindings/python/bt2/test_stream_class.py +++ b/tests/bindings/python/bt2/test_stream_class.py @@ -344,6 +344,20 @@ class StreamClassTestCase(unittest.TestCase): self.assertEqual(len(self._tc), 0) + def test_supports_discarded_events_with_clock_snapshots_without_default_clock_class_raises( + self, + ): + with self.assertRaisesRegex( + ValueError, + 'cannot have no default clock class, but have default clock snapshots for discarded event messages', + ): + self._tc.create_stream_class( + supports_discarded_events=True, + discarded_events_have_default_clock_snapshots=True, + ) + + self.assertEqual(len(self._tc), 0) + def test_supports_discarded_packets_without_cs(self): sc = self._tc.create_stream_class( default_clock_class=self._cc, @@ -406,6 +420,21 @@ class StreamClassTestCase(unittest.TestCase): self.assertEqual(len(self._tc), 0) + def test_supports_discarded_packets_with_clock_snapshots_without_default_clock_class_raises( + self, + ): + with self.assertRaisesRegex( + ValueError, + 'cannot have no default clock class, but have default clock snapshots for discarded packet messages', + ): + self._tc.create_stream_class( + supports_packets=True, + supports_discarded_packets=True, + discarded_packets_have_default_clock_snapshots=True, + ) + + self.assertEqual(len(self._tc), 0) + def test_trace_class(self): sc = self._tc.create_stream_class() self.assertEqual(sc.trace_class.addr, self._tc.addr)