mirror of
https://github.com/certbot/certbot.git
synced 2026-07-27 16:30:31 +02:00
ImmutableMap: repr recursively
This commit is contained in:
@@ -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__':
|
||||
|
||||
Reference in New Issue
Block a user