MCPcopy
hub / github.com/urllib3/urllib3 / test_access_ordering

Method test_access_ordering

test/test_collections.py:58–71  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

56 assert len(d) == 1
57
58 def test_access_ordering(self) -> None:
59 d: Container[int, bool] = Container(5)
60
61 for i in range(10):
62 d[i] = True
63
64 # Keys should be ordered by access time
65 assert list(d._container.keys()) == [5, 6, 7, 8, 9]
66
67 new_order = [7, 8, 6, 9, 5]
68 for k in new_order:
69 d[k]
70
71 assert list(d._container.keys()) == new_order
72
73 def test_delete(self) -> None:
74 d: Container[int, bool] = Container(5)

Callers

nothing calls this directly

Calls 1

keysMethod · 0.45

Tested by

no test coverage detected