Skip to content

Commit b6f7fb2

Browse files
committed
fix: correct import path for SessionMessage
- SessionMessage is in mcp.shared.message, not mcp_types - Format with ruff
1 parent d97ada4 commit b6f7fb2

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

tests/client/test_non2xx_status.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,15 @@
55
66
Closes #3091
77
"""
8+
89
import json
910
import pytest
1011
import httpx
1112
from unittest.mock import AsyncMock, MagicMock, patch
1213

1314
from mcp.client.streamable_http import StreamableHTTPTransport, RequestContext
14-
from mcp_types import JSONRPCRequest, JSONRPCError, ErrorData, SessionMessage
15+
from mcp.shared.message import SessionMessage
16+
from mcp_types import JSONRPCRequest, JSONRPCError, ErrorData
1517

1618

1719
class TestNon2xxStatusHandling:
@@ -122,11 +124,9 @@ async def test_json_error_body_is_parsed(self):
122124

123125
ctx = self._make_request_context()
124126

125-
error_body = json.dumps({
126-
"jsonrpc": "2.0",
127-
"id": "test-123",
128-
"error": {"code": -32600, "message": "Invalid Request"}
129-
}).encode()
127+
error_body = json.dumps(
128+
{"jsonrpc": "2.0", "id": "test-123", "error": {"code": -32600, "message": "Invalid Request"}}
129+
).encode()
130130

131131
mock_response = MagicMock()
132132
mock_response.status_code = 400

0 commit comments

Comments
 (0)