From 286e2bc94da6c7b9f91b2737f695bac3bfc8d31e Mon Sep 17 00:00:00 2001 From: Ross McFarland Date: Thu, 18 Aug 2022 07:42:08 -0700 Subject: [PATCH] Use dict.__repr__ for IdnaDict --- octodns/idna.py | 3 +++ tests/test_octodns_idna.py | 3 +++ 2 files changed, 6 insertions(+) diff --git a/octodns/idna.py b/octodns/idna.py index bf30343..42c5fb7 100644 --- a/octodns/idna.py +++ b/octodns/idna.py @@ -69,3 +69,6 @@ class IdnaDict(MutableMapping): def decoded_items(self): for key, value in self.items(): yield (idna_decode(key), value) + + def __repr__(self): + return self._data.__repr__() diff --git a/tests/test_octodns_idna.py b/tests/test_octodns_idna.py index 2e09401..399d1f6 100644 --- a/tests/test_octodns_idna.py +++ b/tests/test_octodns_idna.py @@ -108,6 +108,9 @@ class TestIdnaDict(TestCase): self.assertFalse(self.utf8 in d) self.assertFalse(idna_encode(self.utf8) in d) + # smoke test of repr + d.__repr__() + def test_keys(self): d = IdnaDict(self.normal)