.gitignore: add some more IDE / tools related file
[babeltrace.git] / tests / bindings / python / bt2 / test_stream_class.py
index f68be98ddede8556dc687548c166c2456f5f318e..3668fe865bb8df2c33ec8ee76d08e7b0afc49ebc 100644 (file)
@@ -4,12 +4,13 @@
 #
 
 import unittest
-from utils import run_in_component_init
-from bt2 import stream_class as bt2_stream_class
-from bt2 import trace_class as bt2_trace_class
+
 from bt2 import clock_class as bt2_clock_class
 from bt2 import event_class as bt2_event_class
 from bt2 import field_class as bt2_field_class
+from bt2 import trace_class as bt2_trace_class
+from bt2 import stream_class as bt2_stream_class
+from utils import run_in_component_init
 
 
 class StreamClassTestCase(unittest.TestCase):
@@ -42,8 +43,8 @@ class StreamClassTestCase(unittest.TestCase):
         self.assertEqual(len(sc.user_attributes), 0)
 
     def test_create_name(self):
-        sc = self._tc.create_stream_class(name='bozo')
-        self.assertEqual(sc.name, 'bozo')
+        sc = self._tc.create_stream_class(name="bozo")
+        self.assertEqual(sc.name, "bozo")
 
     def test_create_invalid_name(self):
         with self.assertRaisesRegex(TypeError, "'int' is not a 'str' object"):
@@ -115,8 +116,8 @@ class StreamClassTestCase(unittest.TestCase):
         self.assertEqual(len(self._tc), 0)
 
     def test_create_user_attributes(self):
-        sc = self._tc.create_stream_class(user_attributes={'salut': 23})
-        self.assertEqual(sc.user_attributes, {'salut': 23})
+        sc = self._tc.create_stream_class(user_attributes={"salut": 23})
+        self.assertEqual(sc.user_attributes, {"salut": 23})
 
     def test_create_invalid_user_attributes(self):
         with self.assertRaisesRegex(
@@ -155,7 +156,7 @@ class StreamClassTestCase(unittest.TestCase):
 
     def test_automatic_stream_ids_wrong_type(self):
         with self.assertRaisesRegex(TypeError, "str' is not a 'bool' object"):
-            self._tc.create_stream_class(assigns_automatic_stream_id='True')
+            self._tc.create_stream_class(assigns_automatic_stream_id="True")
 
         self.assertEqual(len(self._tc), 0)
 
@@ -199,7 +200,7 @@ class StreamClassTestCase(unittest.TestCase):
 
     def test_automatic_event_class_ids_wrong_type(self):
         with self.assertRaisesRegex(TypeError, "'str' is not a 'bool' object"):
-            self._tc.create_stream_class(assigns_automatic_event_class_id='True')
+            self._tc.create_stream_class(assigns_automatic_event_class_id="True")
 
         self.assertEqual(len(self._tc), 0)
 
@@ -349,7 +350,7 @@ class StreamClassTestCase(unittest.TestCase):
     ):
         with self.assertRaisesRegex(
             ValueError,
-            'cannot have no default clock class, but have default clock snapshots for discarded event messages',
+            "cannot have no default clock class, but have default clock snapshots for discarded event messages",
         ):
             self._tc.create_stream_class(
                 supports_discarded_events=True,
@@ -425,7 +426,7 @@ class StreamClassTestCase(unittest.TestCase):
     ):
         with self.assertRaisesRegex(
             ValueError,
-            'cannot have no default clock class, but have default clock snapshots for discarded packet messages',
+            "cannot have no default clock class, but have default clock snapshots for discarded packet messages",
         ):
             self._tc.create_stream_class(
                 supports_packets=True,
@@ -458,12 +459,12 @@ class StreamClassTestCase(unittest.TestCase):
         sc, _, _ = self._create_stream_class_with_event_classes()
 
         with self.assertRaisesRegex(TypeError, "'str' is not an 'int' object"):
-            sc['event23']
+            sc["event23"]
 
     def test_getitem_wrong_key(self):
         sc, _, _ = self._create_stream_class_with_event_classes()
 
-        with self.assertRaisesRegex(KeyError, '19'):
+        with self.assertRaisesRegex(KeyError, "19"):
             sc[19]
 
     def test_len(self):
@@ -478,5 +479,5 @@ class StreamClassTestCase(unittest.TestCase):
         self.assertEqual(ec_ids, [17, 23])
 
 
-if __name__ == '__main__':
+if __name__ == "__main__":
     unittest.main()
This page took 0.025448 seconds and 4 git commands to generate.