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

Function test_tool_index_failure

tests/test_mcp.py:271–278  ·  view source on GitHub ↗

Both tools return a friendly error message when indexing fails.

(cache: _IndexCache, tool: str, args: dict[str, object])

Source from the content-addressed store, hash-verified

269 ],
270)
271async def test_tool_index_failure(cache: _IndexCache, tool: str, args: dict[str, object]) -> None:
272 """Both tools return a friendly error message when indexing fails."""
273 with patch("semble.mcp.SembleIndex.from_git", side_effect=RuntimeError("clone failed")):
274 server = create_server(cache)
275 result = await server.call_tool(tool, args)
276 text = _tool_text(result)
277 assert "Failed to index" in text
278 assert "clone failed" in text
279
280
281@pytest.mark.anyio

Callers

nothing calls this directly

Calls 2

create_serverFunction · 0.90
_tool_textFunction · 0.85

Tested by

no test coverage detected