Skip to content

Commit 09abcf5

Browse files
committed
Add tests on repr(frozendict)
1 parent 258b3df commit 09abcf5

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Lib/test/test_dict.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1766,6 +1766,15 @@ def test_update(self):
17661766
self.assertEqual(d, frozendict({'x': 1, 'y': 2}))
17671767
self.assertEqual(copy, frozendict({'x': 1}))
17681768

1769+
def test_repr(self):
1770+
d = frozendict(x=1, y=2)
1771+
self.assertEqual(repr(d), "frozendict({'x': 1, 'y': 2})")
1772+
1773+
class MyFrozenDict(frozendict):
1774+
pass
1775+
d = MyFrozenDict(x=1, y=2)
1776+
self.assertEqual(repr(d), "MyFrozenDict({'x': 1, 'y': 2})")
1777+
17691778

17701779
if __name__ == "__main__":
17711780
unittest.main()

0 commit comments

Comments
 (0)