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

Function test_query_cache_size

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

Source from the content-addressed store, hash-verified

108
109
110def test_query_cache_size(db):
111 table = db.table('table3', cache_size=1)
112 query = where('int') == 1
113
114 table.insert({'int': 1})
115 table.insert({'int': 1})
116
117 assert table.count(query) == 2
118 assert table.count(where('int') == 2) == 0
119 assert len(table._query_cache) == 1
120
121
122def test_lru_cache(db):

Callers

nothing calls this directly

Calls 4

whereFunction · 0.90
tableMethod · 0.80
insertMethod · 0.80
countMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…