+ self.assertEqual(len(sc), 0)
+
+ def test_supports_packets_without_cs(self):
+ sc = self._tc.create_stream_class(
+ default_clock_class=self._cc, supports_packets=True
+ )
+ self.assertTrue(sc.supports_packets)
+ self.assertFalse(sc.packets_have_beginning_default_clock_snapshot)
+ self.assertFalse(sc.packets_have_end_default_clock_snapshot)
+
+ def test_supports_packets_with_begin_cs(self):
+ sc = self._tc.create_stream_class(
+ default_clock_class=self._cc,
+ supports_packets=True,
+ packets_have_beginning_default_clock_snapshot=True,
+ )
+ self.assertTrue(sc.supports_packets)
+ self.assertTrue(sc.packets_have_beginning_default_clock_snapshot)
+ self.assertFalse(sc.packets_have_end_default_clock_snapshot)
+
+ def test_supports_packets_with_end_cs(self):
+ sc = self._tc.create_stream_class(
+ default_clock_class=self._cc,
+ supports_packets=True,
+ packets_have_end_default_clock_snapshot=True,
+ )
+ self.assertTrue(sc.supports_packets)
+ self.assertFalse(sc.packets_have_beginning_default_clock_snapshot)
+ self.assertTrue(sc.packets_have_end_default_clock_snapshot)
+
+ def test_supports_packets_raises_type_error(self):
+ with self.assertRaisesRegex(TypeError, "'int' is not a 'bool' object"):
+ self._tc.create_stream_class(
+ default_clock_class=self._cc, supports_packets=23
+ )
+
+ self.assertEqual(len(self._tc), 0)
+
+ def test_packets_have_begin_default_cs_raises_type_error(self):
+ with self.assertRaisesRegex(TypeError, "'int' is not a 'bool' object"):
+ self._tc.create_stream_class(
+ default_clock_class=self._cc,
+ packets_have_beginning_default_clock_snapshot=23,
+ )
+
+ self.assertEqual(len(self._tc), 0)
+
+ def test_packets_have_end_default_cs_raises_type_error(self):
+ with self.assertRaisesRegex(TypeError, "'int' is not a 'bool' object"):
+ self._tc.create_stream_class(
+ default_clock_class=self._cc, packets_have_end_default_clock_snapshot=23
+ )
+
+ self.assertEqual(len(self._tc), 0)
+
+ def test_does_not_support_packets_raises_with_begin_cs(self):
+ with self.assertRaisesRegex(
+ ValueError,
+ "cannot not support packets, but have packet beginning default clock snapshot",
+ ):
+ self._tc.create_stream_class(
+ default_clock_class=self._cc,
+ packets_have_beginning_default_clock_snapshot=True,
+ )
+
+ self.assertEqual(len(self._tc), 0)
+
+ def test_does_not_support_packets_raises_with_end_cs(self):
+ with self.assertRaisesRegex(
+ ValueError,
+ "cannot not support packets, but have packet end default clock snapshots",
+ ):
+ self._tc.create_stream_class(
+ default_clock_class=self._cc,
+ packets_have_end_default_clock_snapshot=True,
+ )
+
+ self.assertEqual(len(self._tc), 0)
+
+ def test_supports_discarded_events_without_cs(self):
+ sc = self._tc.create_stream_class(
+ default_clock_class=self._cc, supports_discarded_events=True
+ )
+ self.assertTrue(sc.supports_discarded_events)
+ self.assertFalse(sc.discarded_events_have_default_clock_snapshots)
+
+ def test_supports_discarded_events_with_cs(self):
+ sc = self._tc.create_stream_class(
+ default_clock_class=self._cc,
+ supports_discarded_events=True,
+ discarded_events_have_default_clock_snapshots=True,
+ )
+ self.assertTrue(sc.supports_discarded_events)
+ self.assertTrue(sc.discarded_events_have_default_clock_snapshots)
+
+ def test_supports_discarded_events_raises_type_error(self):
+ with self.assertRaisesRegex(TypeError, "'int' is not a 'bool' object"):
+ self._tc.create_stream_class(
+ default_clock_class=self._cc, supports_discarded_events=23
+ )
+
+ self.assertEqual(len(self._tc), 0)
+
+ def test_discarded_events_have_default_cs_raises_type_error(self):
+ with self.assertRaisesRegex(TypeError, "'int' is not a 'bool' object"):
+ self._tc.create_stream_class(
+ default_clock_class=self._cc,
+ discarded_events_have_default_clock_snapshots=23,
+ )
+
+ self.assertEqual(len(self._tc), 0)
+
+ def test_does_not_support_discarded_events_raises_with_cs(self):
+ with self.assertRaisesRegex(
+ ValueError,
+ "cannot not support discarded events, but have default clock snapshots for discarded event messages",
+ ):
+ self._tc.create_stream_class(
+ default_clock_class=self._cc,
+ discarded_events_have_default_clock_snapshots=True,
+ )
+
+ 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,
+ supports_discarded_packets=True,
+ supports_packets=True,
+ )
+ self.assertTrue(sc.supports_discarded_packets)
+ self.assertFalse(sc.discarded_packets_have_default_clock_snapshots)
+
+ def test_supports_discarded_packets_with_cs(self):
+ sc = self._tc.create_stream_class(
+ default_clock_class=self._cc,
+ supports_discarded_packets=True,
+ discarded_packets_have_default_clock_snapshots=True,
+ supports_packets=True,
+ )
+ self.assertTrue(sc.supports_discarded_packets)
+ self.assertTrue(sc.discarded_packets_have_default_clock_snapshots)
+
+ def test_supports_discarded_packets_raises_without_packet_support(self):
+ with self.assertRaisesRegex(
+ ValueError, "cannot support discarded packets, but not support packets"
+ ):
+ self._tc.create_stream_class(
+ default_clock_class=self._cc, supports_discarded_packets=True
+ )
+
+ self.assertEqual(len(self._tc), 0)
+
+ def test_supports_discarded_packets_raises_type_error(self):
+ with self.assertRaisesRegex(TypeError, "'int' is not a 'bool' object"):
+ self._tc.create_stream_class(
+ default_clock_class=self._cc,
+ supports_discarded_packets=23,
+ supports_packets=True,
+ )
+
+ self.assertEqual(len(self._tc), 0)
+
+ def test_discarded_packets_have_default_cs_raises_type_error(self):
+ with self.assertRaisesRegex(TypeError, "'int' is not a 'bool' object"):
+ self._tc.create_stream_class(
+ default_clock_class=self._cc,
+ discarded_packets_have_default_clock_snapshots=23,
+ supports_packets=True,
+ )
+
+ self.assertEqual(len(self._tc), 0)
+
+ def test_does_not_support_discarded_packets_raises_with_cs(self):
+ with self.assertRaisesRegex(
+ ValueError,
+ "cannot not support discarded packets, but have default clock snapshots for discarded packet messages",
+ ):
+ self._tc.create_stream_class(
+ default_clock_class=self._cc,
+ discarded_packets_have_default_clock_snapshots=True,
+ supports_packets=True,
+ )
+
+ 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)