MCPcopy Index your code
hub / github.com/pydata/xarray / test_simple

Function test_simple

xarray/tests/test_backends_lru_cache.py:11–25  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

9
10
11def test_simple() -> None:
12 cache: LRUCache[Any, Any] = LRUCache(maxsize=2)
13 cache["x"] = 1
14 cache["y"] = 2
15
16 assert cache["x"] == 1
17 assert cache["y"] == 2
18 assert len(cache) == 2
19 assert dict(cache) == {"x": 1, "y": 2}
20 assert list(cache.keys()) == ["x", "y"]
21 assert list(cache.items()) == [("x", 1), ("y", 2)]
22
23 cache["z"] = 3
24 assert len(cache) == 2
25 assert list(cache.items()) == [("y", 2), ("z", 3)]
26
27
28def test_trivial() -> None:

Callers

nothing calls this directly

Calls 3

LRUCacheClass · 0.90
keysMethod · 0.80
itemsMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…