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

Method test_hamt_items_2

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

Source from the content-addressed store, hash-verified

1132 {(A, 'a'), (B, 'b'), (C, 'c'), (D, 'd'), (E, 'e'), (F, 'f')})
1133
1134 def test_hamt_items_2(self):
1135 A = HashKey(100, 'A')
1136 B = HashKey(101, 'B')
1137 C = HashKey(100100, 'C')
1138 D = HashKey(100100, 'D')
1139 E = HashKey(100100, 'E')
1140 F = HashKey(110, 'F')
1141
1142 h = hamt()
1143 h = h.set(A, 'a')
1144 h = h.set(B, 'b')
1145 h = h.set(C, 'c')
1146 h = h.set(D, 'd')
1147 h = h.set(E, 'e')
1148 h = h.set(F, 'f')
1149
1150 it = h.items()
1151 self.assertEqual(
1152 set(list(it)),
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')

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected