mirror of
https://github.com/certbot/certbot.git
synced 2026-06-03 22:08:07 -04:00
ImmutableMap: repr recursively
This commit is contained in:
parent
13128464aa
commit
9d52cb6adc
2 changed files with 2 additions and 1 deletions
|
|
@ -123,5 +123,5 @@ class ImmutableMap(object): # pylint: disable=too-few-public-methods
|
|||
|
||||
def __repr__(self):
|
||||
return '{0}({1})'.format(self.__class__.__name__, ', '.join(
|
||||
'{0}={1}'.format(slot, getattr(self, slot))
|
||||
'{0}={1!r}'.format(slot, getattr(self, slot))
|
||||
for slot in self.__slots__))
|
||||
|
|
|
|||
|
|
@ -160,6 +160,7 @@ class ImmutableMapTest(unittest.TestCase):
|
|||
self.assertEqual('A(x=1, y=2)', repr(self.a1))
|
||||
self.assertEqual('A(x=1, y=2)', repr(self.a1_swap))
|
||||
self.assertEqual('B(x=1, y=2)', repr(self.b))
|
||||
self.assertEqual("B(x='foo', y='bar')", repr(self.B(x='foo', y='bar')))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
|
|
|||
Loading…
Reference in a new issue