Test clearing all cache entries.
(self, temp_cache, sample_result)
| 92 | assert short_cache.get(target, modules) is None |
| 93 | |
| 94 | def test_cache_clear_all(self, temp_cache, sample_result): |
| 95 | """Test clearing all cache entries.""" |
| 96 | targets = ["example.com", "test.com", "sample.com"] |
| 97 | modules = ["osint"] |
| 98 | |
| 99 | for target in targets: |
| 100 | temp_cache.set(target, modules, sample_result) |
| 101 | |
| 102 | assert temp_cache.get_stats()["total_entries"] == 3 |
| 103 | |
| 104 | cleared = temp_cache.clear() |
| 105 | assert cleared == 3 |
| 106 | assert temp_cache.get_stats()["total_entries"] == 0 |
| 107 | |
| 108 | def test_cache_clear_specific_target(self, temp_cache, sample_result): |
| 109 | """Test clearing specific target from cache.""" |