MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_hamt_items_1

Method test_hamt_items_1

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

Source from the content-addressed store, hash-verified

898 self.assertEqual(len(h), 0)
899
900 def test_hamt_items_1(self):
901 A = HashKey(100, 'A')
902 B = HashKey(201001, 'B')
903 C = HashKey(101001, 'C')
904 D = HashKey(103, 'D')
905 E = HashKey(104, 'E')
906 F = HashKey(110, 'F')
907
908 h = hamt()
909 h = h.set(A, 'a')
910 h = h.set(B, 'b')
911 h = h.set(C, 'c')
912 h = h.set(D, 'd')
913 h = h.set(E, 'e')
914 h = h.set(F, 'f')
915
916 it = h.items()
917 self.assertEqual(
918 set(list(it)),
919 {(A, 'a'), (B, 'b'), (C, 'c'), (D, 'd'), (E, 'e'), (F, 'f')})
920
921 def test_hamt_items_2(self):
922 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