mcp endpoint test scaffold

This commit is contained in:
John Lancaster
2026-06-21 17:48:33 -05:00
parent 36347ff4a5
commit 5a31ba6390
2 changed files with 97 additions and 0 deletions
+35
View File
@@ -0,0 +1,35 @@
from __future__ import annotations
from typing import Any
import pytest
from fastapi.testclient import TestClient
pytestmark = pytest.mark.smoke
class TestMcpHttpEndpoints:
"""Covers smoke-level HTTP checks for mounted MCP runtime endpoints."""
class TestHealthz:
"""Covers health endpoint smoke behavior."""
def test_returns_ok_payload(self, client: TestClient) -> None:
"""Ensures GET /healthz responds with a healthy status payload."""
class TestDocsRoute:
"""Covers static docs route smoke behavior."""
def test_serves_docs_entrypoint(self, client: TestClient) -> None:
"""Ensures GET /docs returns the docs site entrypoint response."""
class TestMcpRoute:
"""Covers MCP transport endpoint smoke behavior."""
@pytest.mark.asyncio
async def test_rejects_get_stream_without_support(self, mcp_session: Any) -> None:
"""Ensures GET /mcp returns method not allowed for current transport mode."""
@pytest.mark.asyncio
async def test_accepts_initialize_jsonrpc_request(self, mcp_session_uninitialized: Any) -> None:
"""Ensures POST /mcp accepts an initialize JSON-RPC request."""