File: test_trim_docstring.py

package info (click to toggle)
python-graphene 3.4.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,120 kB
  • sloc: python: 8,935; makefile: 214; sh: 18
file content (22 lines) | stat: -rw-r--r-- 568 bytes parent folder | download
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