graphene/graphene/utils/tests/test_trim_docstring.py
Eran Kampf 7ef3c8ee3e Change dependency to graphql-core-next (#988)
* Changed dependencies to core-next

* Converted Scalars

* ResolveInfo name change

* Ignore .venv

* Make Schema compatible with GraphQL-core-next

* Ignore more venv names and mypy and pytest caches

* Remove print statements for debugging in schema test

* core-next now provides out_type and out_name

* Adapt date and time scalar types to core-next

* Ignore the non-standard result.invalid flag

* Results are named tuples in core-next (immutable)

* Enum values are returned as dict in core-next

* Fix mutation tests with promises

* Make all 345 tests pass with graphql-core-next

* Remove the compat module which was only needed for older Py version

* Remove object as base class (not needed in Py 3)

* We can assume that dicts are ordered in Py 3.6+

* Make use of the fact that dicts are iterable

* Use consistent style of importing from pytest

* Restore compatibility with graphql-relay-py v3

Add adpaters for the PageInfo and Connection args.

* Avoid various deprecation warnings

* Use graphql-core 3 instead of graphql-core-next

* Update dependencies, reformat changes with black

* Update graphene/relay/connection.py

Co-Authored-By: Jonathan Kim <jkimbo@gmail.com>

* Run black on setup.py

* Remove trailing whitespace
2019-08-12 14:04:02 -04:00

23 lines
568 B
Python

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