bt2: test comp. class help attribute
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Wed, 8 Feb 2017 01:20:07 +0000 (20:20 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Sun, 28 May 2017 16:57:37 +0000 (12:57 -0400)
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
tests/bindings/python/bt2/test_comp_notif_iter.py

index b13294af62e10ca2117a7faccb7fb7146333d277..223cab02b05a5ae6d641d90e194a250f1773f4b8 100644 (file)
@@ -122,13 +122,52 @@ class GenCompClassTestCase(unittest.TestCase):
 
     def test_attr_description(self):
         class MySink(bt2.UserSinkComponent):
-            'hello'
+            '''This is the description.
+
+            This is the help.
+
+            This too:
+
+                * And this.
+                * And also that.
+
+            Voilà.
+            '''
+
+            def _consume(self):
+                pass
+
+        sink = MySink()
+        self.assertEqual(sink.component_class.description,
+                         'This is the description.')
+
+    def test_attr_help(self):
+        class MySink(bt2.UserSinkComponent):
+            '''This is the description.
+
+            This is the help.
+
+            This too:
+
+                * And this.
+                * And also that.
+
+            Voilà.
+            '''
 
             def _consume(self):
                 pass
 
         sink = MySink()
-        self.assertEqual(sink.component_class.description, 'hello')
+        expected_help = '''This is the help.
+
+This too:
+
+    * And this.
+    * And also that.
+
+Voilà.'''
+        self.assertEqual(sink.component_class.help, expected_help)
 
     def test_instantiate(self):
         class MySink(bt2.UserSinkComponent):
@@ -173,12 +212,49 @@ class UserCompClassTestCase(unittest.TestCase):
 
     def test_attr_description(self):
         class MySink(bt2.UserSinkComponent):
-            'here is your description'
+            '''This is the description.
+
+            This is the help.
+
+            This too:
+
+                * And this.
+                * And also that.
+
+            Voilà.
+            '''
+
+            def _consume(self):
+                pass
+
+        self.assertEqual(MySink.description, 'This is the description.')
+
+    def test_attr_help(self):
+        class MySink(bt2.UserSinkComponent):
+            '''This is the description.
+
+            This is the help.
+
+            This too:
+
+                * And this.
+                * And also that.
+
+            Voilà.
+            '''
 
             def _consume(self):
                 pass
 
-        self.assertEqual(MySink.description, 'here is your description')
+        expected_help = '''This is the help.
+
+This too:
+
+    * And this.
+    * And also that.
+
+Voilà.'''
+        self.assertEqual(MySink.help, expected_help)
 
     def test_init(self):
         class MySink(bt2.UserSinkComponent):
This page took 0.025529 seconds and 4 git commands to generate.