1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
from ..trim_docstring import trim_docstring
def test_trim_docstring():
class WellDocumentedObject:
"""
This object is very well-documented. It has multiple lines in its
description.
Multiple paragraphs too
"""
assert (
trim_docstring(WellDocumentedObject.__doc__)
== "This object is very well-documented. It has multiple lines in its\n"
"description.\n\nMultiple paragraphs too"
)
class UndocumentedObject:
pass
assert trim_docstring(UndocumentedObject.__doc__) is None
|