Spaces:
Running
Running
Jeremiah Lowin commited on
Commit ·
0653d45
1
Parent(s): 6ea503a
Fix OpenAPI tests
Browse files
tests/server/openapi/test_openapi.py
CHANGED
|
@@ -235,6 +235,7 @@ class TestTools:
|
|
| 235 |
},
|
| 236 |
"required": ["name", "active"],
|
| 237 |
},
|
|
|
|
| 238 |
)
|
| 239 |
assert tools[1].model_dump() == dict(
|
| 240 |
name="update_user_name_users",
|
|
@@ -252,6 +253,7 @@ class TestTools:
|
|
| 252 |
},
|
| 253 |
"required": ["user_id", "name"],
|
| 254 |
},
|
|
|
|
| 255 |
)
|
| 256 |
|
| 257 |
async def test_call_create_user_tool(
|
|
@@ -983,7 +985,9 @@ async def test_none_path_parameters_rejected(
|
|
| 983 |
# Create a client and try to call a tool with a None path parameter
|
| 984 |
async with Client(mcp_server) as client:
|
| 985 |
# get_user has a required path parameter user_id
|
| 986 |
-
with pytest.raises(
|
|
|
|
|
|
|
| 987 |
await client.call_tool(
|
| 988 |
"update_user_name_users",
|
| 989 |
{
|
|
|
|
| 235 |
},
|
| 236 |
"required": ["name", "active"],
|
| 237 |
},
|
| 238 |
+
outputSchema=None,
|
| 239 |
)
|
| 240 |
assert tools[1].model_dump() == dict(
|
| 241 |
name="update_user_name_users",
|
|
|
|
| 253 |
},
|
| 254 |
"required": ["user_id", "name"],
|
| 255 |
},
|
| 256 |
+
outputSchema=None,
|
| 257 |
)
|
| 258 |
|
| 259 |
async def test_call_create_user_tool(
|
|
|
|
| 985 |
# Create a client and try to call a tool with a None path parameter
|
| 986 |
async with Client(mcp_server) as client:
|
| 987 |
# get_user has a required path parameter user_id
|
| 988 |
+
with pytest.raises(
|
| 989 |
+
ToolError, match="Input validation error|Missing required path parameters"
|
| 990 |
+
):
|
| 991 |
await client.call_tool(
|
| 992 |
"update_user_name_users",
|
| 993 |
{
|