(tmock, threshold, tmp_path, fixtures, mock_cache)
| 162 | @mock.patch("aura.cache.get_cache_threshold") |
| 163 | @pytest.mark.parametrize("threshold", (0, 10)) |
| 164 | def test_cache_purge(tmock, threshold, tmp_path, fixtures, mock_cache): |
| 165 | tmock.return_value = threshold |
| 166 | |
| 167 | for k, v in CACHE_ENTRIES.items(): |
| 168 | create_cache_entry(k, v, fixtures=fixtures) |
| 169 | |
| 170 | items = list(cache.CacheItem.analyze()) |
| 171 | cache.CacheItem.cleanup(items=items) |
| 172 | total = sum(x.size for x in items if not x._deleted) |
| 173 | assert total <= threshold |
| 174 | |
| 175 | |
| 176 | @mock.patch("aura.cache.CacheItem.cleanup") |
nothing calls this directly
no test coverage detected