The SSH host key has changed on 8 April, 2022 to this one: SHA256:573uTBSeh74kvOo0HJXi5ijdzRm8me27suzNEDlGyrQ

Add a __repr__ method to Document

main
Gergely Polonkai 3 months ago
parent ae99aba0e0
commit b0a7719bf1
No known key found for this signature in database
GPG Key ID: 2D2885533B869ED4
  1. 3
      earthsnake/document/__init__.py
  2. 9
      tests/test_document_es4.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}>'

@ -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)
== '<Es4Document /test.txt by @test.bcz76z52y5dlpohtkmpuj3jsdcvfmebzpcgfmtmhu4u7hlexzreya>'
)

Loading…
Cancel
Save