MCPcopy
hub / github.com/pallets/jinja / test_setdefault

Method test_setdefault

tests/test_utils.py:97–104  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

95 assert list(reversed(d)) == ["c", "b", "a"]
96
97 def test_setdefault(self):
98 d = LRUCache(3)
99 assert len(d) == 0
100 assert d.setdefault("a") is None
101 assert d.setdefault("a", 1) is None
102 assert len(d) == 1
103 assert d.setdefault("b", 2) == 2
104 assert len(d) == 2
105
106
107class TestHelpers:

Callers

nothing calls this directly

Calls 2

setdefaultMethod · 0.95
LRUCacheClass · 0.90

Tested by

no test coverage detected