A cache save failure must not fail the MCP request.
(cache: _IndexCache, tmp_path: Path)
| 251 | |
| 252 | @pytest.mark.anyio |
| 253 | async 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 |