MCPcopy
hub / github.com/MinishLab/semble / test_get_validated_cache_manifest_mismatch

Function test_get_validated_cache_manifest_mismatch

tests/test_cache.py:330–345  ·  view source on GitHub ↗

Returns None when the current file set differs from the stored manifest.

(
    stored_files: list[str], current_files: list[str], tmp_path: Path
)

Source from the content-addressed store, hash-verified

328 ],
329)
330def test_get_validated_cache_manifest_mismatch(
331 stored_files: list[str], current_files: list[str], tmp_path: Path
332) -> None:
333 """Returns None when the current file set differs from the stored manifest."""
334 index_path = tmp_path / "index"
335 walk_return = []
336 for f in current_files:
337 p = tmp_path / f
338 # Make sure file is not empty
339 p.write_text("a")
340 walk_return.append(p)
341 _write_metadata(index_path, "my/model", ["code"], float("inf"), file_paths=stored_files)
342 with patch("semble.cache.find_index_from_cache_folder", return_value=index_path):
343 with patch("semble.cache.walk_files", return_value=walk_return):
344 result = get_validated_cache(str(tmp_path), "my/model", [ContentType.CODE])
345 assert result is None

Callers

nothing calls this directly

Calls 2

get_validated_cacheFunction · 0.90
_write_metadataFunction · 0.85

Tested by

no test coverage detected