From: Philippe Proulx Date: Wed, 8 Feb 2017 01:20:07 +0000 (-0500) Subject: bt2: test comp. class help attribute X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=feb5fe23a635825a74165977d7e6e4389d052e8d;p=deliverable%2Fbabeltrace.git bt2: test comp. class help attribute Signed-off-by: Philippe Proulx Signed-off-by: Jérémie Galarneau --- diff --git a/tests/bindings/python/bt2/test_comp_notif_iter.py b/tests/bindings/python/bt2/test_comp_notif_iter.py index b13294af6..223cab02b 100644 --- a/tests/bindings/python/bt2/test_comp_notif_iter.py +++ b/tests/bindings/python/bt2/test_comp_notif_iter.py @@ -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):