MCPcopy Create free account
hub / github.com/RustPython/RustPython / test_hamt_in_1

Method test_hamt_in_1

Lib/test/test_context.py:1072–1090  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1070 self.assertIsNone(ref())
1071
1072 def test_hamt_in_1(self):
1073 A = HashKey(100, 'A')
1074 AA = HashKey(100, 'A')
1075
1076 B = HashKey(101, 'B')
1077
1078 h = hamt()
1079 h = h.set(A, 1)
1080
1081 self.assertTrue(A in h)
1082 self.assertFalse(B in h)
1083
1084 with self.assertRaises(EqError):
1085 with HaskKeyCrasher(error_on_eq=True):
1086 AA in h
1087
1088 with self.assertRaises(HashingError):
1089 with HaskKeyCrasher(error_on_hash=True):
1090 AA in h
1091
1092 def test_hamt_getitem_1(self):
1093 A = HashKey(100, 'A')

Callers

nothing calls this directly

Calls 6

HashKeyClass · 0.85
HaskKeyCrasherClass · 0.85
assertTrueMethod · 0.80
assertFalseMethod · 0.80
setMethod · 0.45
assertRaisesMethod · 0.45

Tested by

no test coverage detected