Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit abea28a

Browse files
authored
Merge 49ae900 into sapling-pr-archive-rm-openai
2 parents 2c25489 + 49ae900 commit abea28a

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

tests/mcp/test_mcp_util.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,10 @@ async def test_get_all_function_tools():
6464

6565
for idx, tool in enumerate(tools):
6666
assert isinstance(tool, FunctionTool)
67-
assert tool.params_json_schema == schemas[idx]
67+
if schemas[idx] == {}:
68+
assert tool.params_json_schema == snapshot({"properties": {}})
69+
else:
70+
assert tool.params_json_schema == schemas[idx]
6871
assert tool.name == names[idx]
6972

7073
# Also make sure it works with strict schemas
@@ -168,10 +171,7 @@ async def test_agent_convert_schemas_true():
168171

169172
# Checks that additionalProperties is set to False
170173
assert bar_tool.params_json_schema == snapshot(
171-
{
172-
"type": "object",
173-
"additionalProperties": {"type": "string"},
174-
}
174+
{"type": "object", "additionalProperties": {"type": "string"}, "properties": {}}
175175
)
176176
assert bar_tool.strict_json_schema is False, "bar_tool should not be strict"
177177

@@ -221,7 +221,9 @@ async def test_agent_convert_schemas_false():
221221
assert foo_tool.params_json_schema == strict_schema
222222
assert foo_tool.strict_json_schema is False, "Shouldn't be converted unless specified"
223223

224-
assert bar_tool.params_json_schema == non_strict_schema
224+
assert bar_tool.params_json_schema == snapshot(
225+
{"type": "object", "additionalProperties": {"type": "string"}, "properties": {}}
226+
)
225227
assert bar_tool.strict_json_schema is False
226228

227229
assert baz_tool.params_json_schema == possible_to_convert_schema
@@ -256,7 +258,9 @@ async def test_agent_convert_schemas_unset():
256258
assert foo_tool.params_json_schema == strict_schema
257259
assert foo_tool.strict_json_schema is False, "Shouldn't be converted unless specified"
258260

259-
assert bar_tool.params_json_schema == non_strict_schema
261+
assert bar_tool.params_json_schema == snapshot(
262+
{"type": "object", "additionalProperties": {"type": "string"}, "properties": {}}
263+
)
260264
assert bar_tool.strict_json_schema is False
261265

262266
assert baz_tool.params_json_schema == possible_to_convert_schema

0 commit comments

Comments
 (0)