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

Function test_from_path_uses_cache_when_valid

tests/index/test_index.py:237–243  ·  view source on GitHub ↗

from_path returns the cached index directly when get_validated_cache hits.

(tmp_project: Path)

Source from the content-addressed store, hash-verified

235
236
237def test_from_path_uses_cache_when_valid(tmp_project: Path) -> None:
238 """from_path returns the cached index directly when get_validated_cache hits."""
239 fake_cached = MagicMock(spec=SembleIndex)
240 with patch("semble.index.index.get_validated_cache", return_value=tmp_project / "cache"):
241 with patch.object(SembleIndex, "load_from_disk", return_value=fake_cached):
242 result = SembleIndex.from_path(tmp_project)
243 assert result is fake_cached
244
245
246@pytest.mark.parametrize("ref", [None, "v1.0"])

Callers

nothing calls this directly

Calls 1

from_pathMethod · 0.45

Tested by

no test coverage detected