Skip to content

Commit 7d8ec65

Browse files
committed
fix(build): add more test coverage
Signed-off-by: Samantha Coyle <sam@diagrid.io>
1 parent f0d5fb3 commit 7d8ec65

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

tests/issues/test_streamable_http_405_get_stream.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,3 +117,21 @@ async def test_mock_github_endpoint_other_method_returns_405() -> None:
117117
response = await http_client.delete("/mcp")
118118

119119
assert response.status_code == 405
120+
121+
122+
@pytest.mark.anyio
123+
async def test_mock_github_endpoint_post_unknown_method_returns_405() -> None:
124+
"""Ensure POST with unknown method hits fallback 405 branch."""
125+
app = Starlette(routes=[Route("/mcp", mock_github_endpoint, methods=["POST"])])
126+
127+
async with httpx.AsyncClient(
128+
transport=httpx.ASGITransport(app=app),
129+
base_url="http://testserver",
130+
timeout=5.0,
131+
) as http_client:
132+
response = await http_client.post(
133+
"/mcp",
134+
json={"jsonrpc": "2.0", "id": 1, "method": "unknown/method"},
135+
)
136+
137+
assert response.status_code == 405

0 commit comments

Comments
 (0)