MCPcopy Index your code
hub / github.com/python/cpython / test_hamt_in_1

Method test_hamt_in_1

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

Source from the content-addressed store, hash-verified

1283 self.assertIsNone(ref())
1284
1285 def test_hamt_in_1(self):
1286 A = HashKey(100, 'A')
1287 AA = HashKey(100, 'A')
1288
1289 B = HashKey(101, 'B')
1290
1291 h = hamt()
1292 h = h.set(A, 1)
1293
1294 self.assertTrue(A in h)
1295 self.assertFalse(B in h)
1296
1297 with self.assertRaises(EqError):
1298 with HaskKeyCrasher(error_on_eq=True):
1299 AA in h
1300
1301 with self.assertRaises(HashingError):
1302 with HaskKeyCrasher(error_on_hash=True):
1303 AA in h
1304
1305 def test_hamt_getitem_1(self):
1306 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