Test setting and getting cache entries.
(self, temp_cache, sample_result)
| 46 | """Tests for ScanCache.""" |
| 47 | |
| 48 | def test_cache_set_and_get(self, temp_cache, sample_result): |
| 49 | """Test setting and getting cache entries.""" |
| 50 | target = "example.com" |
| 51 | modules = ["osint", "webscanner"] |
| 52 | |
| 53 | temp_cache.set(target, modules, sample_result) |
| 54 | |
| 55 | cached = temp_cache.get(target, modules) |
| 56 | assert cached is not None |
| 57 | assert cached.target.value == target |
| 58 | assert len(cached.findings) == 1 |
| 59 | |
| 60 | def test_cache_miss(self, temp_cache): |
| 61 | """Test cache miss returns None.""" |