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

Method test_pickleable

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

Source from the content-addressed store, hash-verified

37 assert cache.values() == []
38
39 def test_pickleable(self):
40 cache = LRUCache(2)
41 cache["foo"] = 42
42 cache["bar"] = 23
43 cache["foo"]
44
45 for protocol in range(3):
46 copy = pickle.loads(pickle.dumps(cache, protocol))
47 assert copy.capacity == cache.capacity
48 assert copy._mapping == cache._mapping
49 assert copy._queue == cache._queue
50
51 @pytest.mark.parametrize("copy_func", [LRUCache.copy, shallow_copy])
52 def test_copy(self, copy_func):

Callers

nothing calls this directly

Calls 1

LRUCacheClass · 0.90

Tested by

no test coverage detected