File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -1558,7 +1558,9 @@ async def test_read_resource_not_found(mcp_server: MCPServerStdio) -> None:
15581558
15591559async def test_list_resources_error (mcp_server : MCPServerStdio ) -> None :
15601560 """Test that list_resources converts McpError to MCPServerError."""
1561- mcp_error = McpError (error = ErrorData (code = - 32603 , message = 'Failed to list resources' ))
1561+ mcp_error = McpError (
1562+ error = ErrorData (code = - 32603 , message = 'Failed to list resources' , data = {'details' : 'server overloaded' })
1563+ )
15621564
15631565 async with mcp_server :
15641566 with patch .object (
@@ -1572,6 +1574,10 @@ async def test_list_resources_error(mcp_server: MCPServerStdio) -> None:
15721574 # Verify the exception has the expected attributes
15731575 assert exc_info .value .code == - 32603
15741576 assert exc_info .value .message == 'Failed to list resources'
1577+ assert exc_info .value .data == {'details' : 'server overloaded' }
1578+ assert (
1579+ str (exc_info .value ) == "Failed to list resources (code: -32603, data: {'details': 'server overloaded'})"
1580+ )
15751581
15761582
15771583async def test_list_resource_templates_error (mcp_server : MCPServerStdio ) -> None :
You can’t perform that action at this time.
0 commit comments