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

Method test_hamt_getitem_1

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

Source from the content-addressed store, hash-verified

1303 AA in h
1304
1305 def test_hamt_getitem_1(self):
1306 A = HashKey(100, 'A')
1307 AA = HashKey(100, 'A')
1308
1309 B = HashKey(101, 'B')
1310
1311 h = hamt()
1312 h = h.set(A, 1)
1313
1314 self.assertEqual(h[A], 1)
1315 self.assertEqual(h[AA], 1)
1316
1317 with self.assertRaises(KeyError):
1318 h[B]
1319
1320 with self.assertRaises(EqError):
1321 with HaskKeyCrasher(error_on_eq=True):
1322 h[AA]
1323
1324 with self.assertRaises(HashingError):
1325 with HaskKeyCrasher(error_on_hash=True):
1326 h[AA]
1327
1328
1329if __name__ == "__main__":

Callers

nothing calls this directly

Calls 5

HashKeyClass · 0.85
HaskKeyCrasherClass · 0.85
setMethod · 0.45
assertEqualMethod · 0.45
assertRaisesMethod · 0.45

Tested by

no test coverage detected