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

Method test_hamt_keys_1

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

Source from the content-addressed store, hash-verified

1153 {(A, 'a'), (B, 'b'), (C, 'c'), (D, 'd'), (E, 'e'), (F, 'f')})
1154
1155 def test_hamt_keys_1(self):
1156 A = HashKey(100, 'A')
1157 B = HashKey(101, 'B')
1158 C = HashKey(100100, 'C')
1159 D = HashKey(100100, 'D')
1160 E = HashKey(100100, 'E')
1161 F = HashKey(110, 'F')
1162
1163 h = hamt()
1164 h = h.set(A, 'a')
1165 h = h.set(B, 'b')
1166 h = h.set(C, 'c')
1167 h = h.set(D, 'd')
1168 h = h.set(E, 'e')
1169 h = h.set(F, 'f')
1170
1171 self.assertEqual(set(list(h.keys())), {A, B, C, D, E, F})
1172 self.assertEqual(set(list(h)), {A, B, C, D, E, F})
1173
1174 def test_hamt_items_3(self):
1175 h = hamt()

Callers

nothing calls this directly

Calls 6

HashKeyClass · 0.85
setFunction · 0.85
listClass · 0.85
setMethod · 0.45
assertEqualMethod · 0.45
keysMethod · 0.45

Tested by

no test coverage detected