28 lines
838 B
Python
28 lines
838 B
Python
"""Server tool wiring tests."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from mcp_server import tools
|
|
|
|
|
|
def test_list_tools_round_trip() -> None:
|
|
"""ListTools returns catalog entries."""
|
|
payload = tools.list_tools_payload()
|
|
tool_list = payload["tools"]
|
|
assert isinstance(tool_list, list)
|
|
assert any(entry["name"] == "show-constitution" for entry in tool_list)
|
|
|
|
|
|
def test_invoke_tool_round_trip() -> None:
|
|
"""InvokeTool returns standard shape."""
|
|
result = tools.invoke_tool("show-constitution", {})
|
|
assert result["status"] in {"ok", "unsupported", "invalid_input"}
|
|
assert "output" in result
|
|
|
|
|
|
def test_sync_docs_response_shape() -> None:
|
|
"""SyncDocs returns expected fields."""
|
|
result = tools.invoke_tool("sync-docs", {})
|
|
assert "status" in result
|
|
assert "missingInDocs" in result["output"]
|