(db)
| 120 | |
| 121 | |
| 122 | def test_lru_cache(db): |
| 123 | # Test integration into TinyDB |
| 124 | table = db.table('table3', cache_size=2) |
| 125 | query = where('int') == 1 |
| 126 | |
| 127 | table.search(query) |
| 128 | table.search(where('int') == 2) |
| 129 | table.search(where('int') == 3) |
| 130 | assert query not in table._query_cache |
| 131 | |
| 132 | table.remove(where('int') == 1) |
| 133 | assert not table._query_cache.lru |
| 134 | |
| 135 | table.search(query) |
| 136 | |
| 137 | assert len(table._query_cache) == 1 |
| 138 | table.clear_cache() |
| 139 | assert len(table._query_cache) == 0 |
| 140 | |
| 141 | |
| 142 | def test_table_is_iterable(db): |
nothing calls this directly
no test coverage detected
searching dependent graphs…