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

Function test_index_cache_ignores_cache_save_failure

tests/test_mcp.py:253–260  ·  view source on GitHub ↗

A cache save failure must not fail the MCP request.

(cache: _IndexCache, tmp_path: Path)

Source from the content-addressed store, hash-verified

251
252@pytest.mark.anyio
253async def test_index_cache_ignores_cache_save_failure(cache: _IndexCache, tmp_path: Path) -> None:
254 """A cache save failure must not fail the MCP request."""
255 fake_index = MagicMock()
256 with (
257 patch("semble.mcp.SembleIndex.from_path", return_value=fake_index),
258 patch("semble.mcp.save_index_to_cache", side_effect=RuntimeError("save failed")),
259 ):
260 assert await cache.get(str(tmp_path)) is fake_index
261
262
263@pytest.mark.anyio

Callers

nothing calls this directly

Calls 1

getMethod · 0.80

Tested by

no test coverage detected