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

Function test_get_validated_cache_metadata_mismatch

tests/test_cache.py:176–187  ·  view source on GitHub ↗

Returns None when stored model or content type doesn't match the request.

(
    stored_model: str,
    stored_content: list[str],
    req_model: str,
    req_content: list[ContentType],
    tmp_path: Path,
)

Source from the content-addressed store, hash-verified

174 ],
175)
176def test_get_validated_cache_metadata_mismatch(
177 stored_model: str,
178 stored_content: list[str],
179 req_model: str,
180 req_content: list[ContentType],
181 tmp_path: Path,
182) -> None:
183 """Returns None when stored model or content type doesn't match the request."""
184 index_path = tmp_path / "index"
185 _write_metadata(index_path, stored_model, stored_content, 0.0)
186 with patch("semble.cache.find_index_from_cache_folder", return_value=index_path):
187 assert get_validated_cache("/path", req_model, req_content) is None
188
189
190def test_get_validated_cache_reads_utf8_metadata_with_non_ascii_file_paths(tmp_path: Path) -> None:

Callers

nothing calls this directly

Calls 2

get_validated_cacheFunction · 0.90
_write_metadataFunction · 0.85

Tested by

no test coverage detected