aboutsummaryrefslogtreecommitdiff
path: root/tests/test_map.py
diff options
context:
space:
mode:
authorOfek Lev <ofekmeister@gmail.com>2021-02-09 15:32:01 -0500
committerGitHub <noreply@github.com>2021-02-09 14:32:01 -0600
commit8af150216acfc2a900c648ade713df947b903970 (patch)
tree23ca32580a8547c9604713392fa5707b19463691 /tests/test_map.py
parentd7f3eebbc1b8b2d06633dacd4c81de1386b9b3fa (diff)
downloadimmutables-8af150216acfc2a900c648ade713df947b903970.tar.gz
immutables-8af150216acfc2a900c648ade713df947b903970.zip
Make __repr__ more similar to other mapping types (#58)
Diffstat (limited to 'tests/test_map.py')
-rw-r--r--tests/test_map.py11
1 files changed, 4 insertions, 7 deletions
diff --git a/tests/test_map.py b/tests/test_map.py
index b6ee7f1..4a473b3 100644
--- a/tests/test_map.py
+++ b/tests/test_map.py
@@ -845,11 +845,10 @@ class BaseMapTest:
def test_repr_1(self):
h = self.Map()
- self.assertTrue(repr(h).startswith('<immutables.Map({}) at 0x'))
+ self.assertEqual(repr(h), 'immutables.Map({})')
h = h.set(1, 2).set(2, 3).set(3, 4)
- self.assertTrue(repr(h).startswith(
- '<immutables.Map({1: 2, 2: 3, 3: 4}) at 0x'))
+ self.assertEqual(repr(h), 'immutables.Map({1: 2, 2: 3, 3: 4})')
def test_repr_2(self):
h = self.Map()
@@ -879,8 +878,7 @@ class BaseMapTest:
h = h.set(k, 1)
k.val = h
- self.assertTrue(repr(h).startswith(
- '<immutables.Map({{...}: 1}) at 0x'))
+ self.assertEqual(repr(h), 'immutables.Map({{...}: 1})')
def test_hash_1(self):
h = self.Map()
@@ -964,8 +962,7 @@ class BaseMapTest:
h = h.set('a', 1)
hm1 = h.mutate()
- self.assertTrue(repr(hm1).startswith(
- "<immutables.MapMutation({'a': 1})"))
+ self.assertEqual(repr(hm1), "immutables.MapMutation({'a': 1})")
with self.assertRaisesRegex(TypeError, 'unhashable type'):
hash(hm1)