Skip to content

Commit f0d5fb3

Browse files
committed
fix(build): up test coverage
Signed-off-by: Samantha Coyle <sam@diagrid.io>
1 parent 0ee54bc commit f0d5fb3

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/issues/test_streamable_http_405_get_stream.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,3 +102,18 @@ async def test_405_get_stream_does_not_hang(caplog: pytest.LogCaptureFixture):
102102

103103
reconnect_messages = [msg for msg in log_messages if "reconnecting" in msg.lower()]
104104
assert len(reconnect_messages) == 0, f"Should not retry on 405, but found: {reconnect_messages}"
105+
106+
107+
@pytest.mark.anyio
108+
async def test_mock_github_endpoint_other_method_returns_405() -> None:
109+
"""Ensure fallback 405 branch is covered for non-GET/POST methods."""
110+
app = Starlette(routes=[Route("/mcp", mock_github_endpoint, methods=["GET", "POST", "DELETE"])])
111+
112+
async with httpx.AsyncClient(
113+
transport=httpx.ASGITransport(app=app),
114+
base_url="http://testserver",
115+
timeout=5.0,
116+
) as http_client:
117+
response = await http_client.delete("/mcp")
118+
119+
assert response.status_code == 405

0 commit comments

Comments
 (0)