MCPcopy
hub / github.com/msiemens/tinydb / test_query_cache

Function test_query_cache

tests/test_tables.py:59–74  ·  view source on GitHub ↗
(db)

Source from the content-addressed store, hash-verified

57
58
59def test_query_cache(db):
60 query1 = where('int') == 1
61
62 assert db.count(query1) == 3
63 assert query1 in db._query_cache
64
65 assert db.count(query1) == 3
66 assert query1 in db._query_cache
67
68 query2 = where('int') == 0
69
70 assert db.count(query2) == 0
71 assert query2 in db._query_cache
72
73 assert db.count(query2) == 0
74 assert query2 in db._query_cache
75
76
77def test_query_cache_with_mutable_callable(db):

Callers

nothing calls this directly

Calls 2

whereFunction · 0.90
countMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…