MCPcopy
hub / github.com/Textualize/textual / test_cache_on

Function test_cache_on

tests/suggester/test_suggester.py:24–36  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

22
23
24async def test_cache_on():
25 log = []
26
27 class MySuggester(Suggester):
28 async def get_suggestion(self, value: str):
29 log.append(value)
30 return value
31
32 suggester = MySuggester(use_cache=True)
33 await suggester._get_suggestion(DOMNode(), "hello")
34 assert log == ["hello"]
35 await suggester._get_suggestion(DOMNode(), "hello")
36 assert log == ["hello"]
37
38
39async def test_cache_off():

Callers

nothing calls this directly

Calls 3

DOMNodeClass · 0.90
MySuggesterClass · 0.85
_get_suggestionMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…