MCPcopy
hub / github.com/GitGuardian/ggshield / test_save_cache

Method test_save_cache

tests/unit/core/test_cache.py:39–49  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

37 assert "Unrecognized key in cache" in captured.err
38
39 def test_save_cache(self):
40 with open(".cache_ggshield", "w") as file:
41 json.dump({}, file)
42 cache = Cache()
43 cache.update_cache(last_found_secrets=[{"match": "XXX"}])
44 cache.save()
45 with open(".cache_ggshield") as file:
46 file_content = json.load(file)
47 assert file_content == {
48 "last_found_secrets": [{"match": "XXX", "name": ""}]
49 }
50
51 def test_read_only_fs(self):
52 """

Callers

nothing calls this directly

Calls 4

update_cacheMethod · 0.95
saveMethod · 0.95
CacheClass · 0.90
loadMethod · 0.45

Tested by

no test coverage detected