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

Method test_hamt_items_1

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

Source from the content-addressed store, hash-verified

1111 self.assertEqual(len(h), 0)
1112
1113 def test_hamt_items_1(self):
1114 A = HashKey(100, 'A')
1115 B = HashKey(201001, 'B')
1116 C = HashKey(101001, 'C')
1117 D = HashKey(103, 'D')
1118 E = HashKey(104, 'E')
1119 F = HashKey(110, 'F')
1120
1121 h = hamt()
1122 h = h.set(A, 'a')
1123 h = h.set(B, 'b')
1124 h = h.set(C, 'c')
1125 h = h.set(D, 'd')
1126 h = h.set(E, 'e')
1127 h = h.set(F, 'f')
1128
1129 it = h.items()
1130 self.assertEqual(
1131 set(list(it)),
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')

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