MCPcopy Create free account
hub / github.com/TheSecuredAnalyst/security-suite / test_cache_set_and_get

Method test_cache_set_and_get

tests/test_cache.py:48–58  ·  view source on GitHub ↗

Test setting and getting cache entries.

(self, temp_cache, sample_result)

Source from the content-addressed store, hash-verified

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."""

Callers

nothing calls this directly

Calls 2

setMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected