projects
/
babeltrace.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: bt2: _trim_docstring(): docstring can have 0 or 1 line
[babeltrace.git]
/
tests
/
bindings
/
python
/
bt2
/
test_component_class.py
diff --git
a/tests/bindings/python/bt2/test_component_class.py
b/tests/bindings/python/bt2/test_component_class.py
index 685a0b996487f7ba75b607a263270f0561972ecc..bee368a13055f0553b0307358419f483ea65aa91 100644
(file)
--- a/
tests/bindings/python/bt2/test_component_class.py
+++ b/
tests/bindings/python/bt2/test_component_class.py
@@
-114,16
+114,38
@@
class UserComponentClassTestCase(unittest.TestCase):
self.assertEqual(MySink.description, 'The description.')
self.assertEqual(MySink.description, 'The description.')
- def test_empty_description(self):
+ def test_empty_description
_no_lines
(self):
class MySink(bt2._UserSinkComponent):
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 _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):
"""
def test_help(self):
class MySink(bt2._UserSinkComponent):
"""
This page took
0.025275 seconds
and
4
git commands to generate.