Reformat Python files with Black v20.8b1
[babeltrace.git] / tests / bindings / python / bt2 / test_component_class.py
index 685a0b996487f7ba75b607a263270f0561972ecc..08b0c02be1177be878381f937b2396f309000de9 100644 (file)
@@ -114,16 +114,38 @@ class UserComponentClassTestCase(unittest.TestCase):
 
         self.assertEqual(MySink.description, 'The description.')
 
-    def test_empty_description(self):
+    def test_empty_description_no_lines(self):
         class MySink(bt2._UserSinkComponent):
+            # fmt: off
+            """"""
+            # fmt: on
+
+            def _user_consume(self):
+                pass
+
+        self.assertIsNone(MySink.description)
+
+    def test_empty_description_no_contents(self):
+        class MySink(bt2._UserSinkComponent):
+            # fmt: off
             """
             """
+            # fmt: on
 
             def _user_consume(self):
                 pass
 
         self.assertIsNone(MySink.description)
 
+    def test_empty_description_single_line(self):
+        class MySink(bt2._UserSinkComponent):
+            """my description"""
+
+            def _user_consume(self):
+                pass
+
+        self.assertEqual(MySink.description, "my description")
+
     def test_help(self):
         class MySink(bt2._UserSinkComponent):
             """
@@ -278,11 +300,11 @@ class UserComponentClassTestCase(unittest.TestCase):
 class ComponentClassTestCase(unittest.TestCase):
     def setUp(self):
         class MySink(bt2._UserSinkComponent):
-            '''
+            """
             The description.
 
             The help.
-            '''
+            """
 
             def _user_consume(self):
                 pass
This page took 0.023477 seconds and 4 git commands to generate.