diff --git a/earthsnake/document/__init__.py b/earthsnake/document/__init__.py index a135646..88bb6e4 100644 --- a/earthsnake/document/__init__.py +++ b/earthsnake/document/__init__.py @@ -30,3 +30,6 @@ class Document(ABC): # pragma: no cover pylint: disable=too-few-public-methods If ``identity`` is ``None``, use ``self.author`` instead. """ + + def __repr__(self) -> str: + return f'<{self.__class__.__name__} {self.path} by {self.author}>' diff --git a/tests/test_document_es4.py b/tests/test_document_es4.py index 6532cb9..2faeced 100644 --- a/tests/test_document_es4.py +++ b/tests/test_document_es4.py @@ -257,3 +257,12 @@ def test_content_length(es4_document: Es4Document) -> None: """Test the content_length property""" assert es4_document.content_length == 4 + + +def test_repr(es4_document: Es4Document) -> None: + """Test the __repr__ method of Es4Document""" + + assert ( + repr(es4_document) + == '' + )