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

Mark signing identities as such in Identity.__repr__

main
Gergely Polonkai 3 months ago
parent d602d9c3ba
commit 547c6b5205
No known key found for this signature in database
GPG Key ID: 2D2885533B869ED4
  1. 3
      earthsnake/identity.py
  2. 13
      tests/test_identity.py

@ -56,6 +56,9 @@ class Identity:
return f'@{self.name}.{base32_bytes_to_string(self.verify_key.to_bytes())}'
def __repr__(self) -> str:
if self.sign_key:
return f'<Identity (signer) {self}>'
return f'<Identity {self}>'
def __eq__(self, other: object) -> bool:

@ -67,7 +67,18 @@ def test_str(identity: Identity) -> None:
@pytest.mark.id_key_seed(TEST_SEED)
@pytest.mark.id_name('test')
def test_repr(identity: Identity) -> None:
"""Test if the __str__ method returns the author address"""
"""Test if the __repr__ method returns the author address"""
assert (
repr(identity)
== '<Identity (signer) @test.bcz76z52y5dlpohtkmpuj3jsdcvfmebzpcgfmtmhu4u7hlexzreya>'
)
def test_repr_nosign() -> None:
"""Test the __repr__ method marks the identity as a signer in the output"""
identity = Identity.from_address('@test.bcz76z52y5dlpohtkmpuj3jsdcvfmebzpcgfmtmhu4u7hlexzreya')
assert (
repr(identity) == '<Identity @test.bcz76z52y5dlpohtkmpuj3jsdcvfmebzpcgfmtmhu4u7hlexzreya>'

Loading…
Cancel
Save