25 lines
721 B
Python
25 lines
721 B
Python
import asyncio
|
|
import json
|
|
|
|
import pytest
|
|
|
|
pytest.importorskip("mcp")
|
|
|
|
|
|
def test_mcp_exposes_ops(example):
|
|
from pipewright.mcp_server import build_server
|
|
|
|
d = example("issue_triage")
|
|
server = build_server()
|
|
|
|
async def main():
|
|
names = {t.name for t in await server.list_tools()}
|
|
res = await server.call_tool("check_graph", {"graph": str(d / "graph.py")})
|
|
return names, res
|
|
|
|
names, res = asyncio.run(main())
|
|
assert {"nodes_describe", "check_graph", "patch_graph", "preview", "run_graph", "funnel", "items", "query",
|
|
"lineage", "hosts"} <= names
|
|
content = res.content if hasattr(res, "content") else res[0]
|
|
assert json.loads(content[0].text)["ok"] is True
|