feat: register 12 MCP tools on FastAPI app

This commit is contained in:
Claude
2026-06-24 14:50:51 +08:00
parent 0d60f9b246
commit cc7eafaa16
3 changed files with 143 additions and 2 deletions
+33
View File
@@ -0,0 +1,33 @@
# coding=utf-8
from fastapi.testclient import TestClient
from spark_executor.server import app
def test_health_still_present():
c = TestClient(app)
r = c.get("/health")
assert r.status_code == 200
assert r.json() == {"status": "ok"}
def test_twelve_tool_routes_registered():
paths = {r.path for r in app.routes}
for path in (
# pending-submission flow (5)
"/prepare_submit_job",
"/confirm_submit_job",
"/list_pending_jobs",
"/get_pending_job",
"/cancel_pending_job",
# job lifecycle (3)
"/get_job_status",
"/get_job_logs",
"/kill_job",
# connection management (4)
"/save_connection",
"/list_connections",
"/get_connection",
"/delete_connection",
):
assert path in paths, f"missing MCP tool route: {path}"