Skip to content

Commit 5109e64

Browse files
committed
test: update test_pydantic_model_function for inlined $ref schema (#2384)
After the dereference_local_refs fix, the UserInput model's properties land directly under tool.parameters["properties"]["user"]["properties"] instead of inside the $defs container. Update the test assertions to match the new (LLM-consumable) schema shape. This is the only test in test_tool_manager.py that was checking the $defs location; all other tests check tool behavior or per-property fields that are unaffected by the inlining. Signed-off-by: Mukunda Katta <mukunda.vjcs6@gmail.com>
1 parent c21eea3 commit 5109e64

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tests/server/mcpserver/test_tool_manager.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,10 @@ def create_user(user: UserInput, flag: bool) -> dict[str, Any]: # pragma: no co
100100
assert tool.name == "create_user"
101101
assert tool.description == "Create a new user."
102102
assert tool.is_async is False
103-
assert "name" in tool.parameters["$defs"]["UserInput"]["properties"]
104-
assert "age" in tool.parameters["$defs"]["UserInput"]["properties"]
103+
# $ref is now inlined (see dereference_local_refs in utilities/schema.py).
104+
# The UserInput definition is merged directly into properties.user.
105+
assert "name" in tool.parameters["properties"]["user"]["properties"]
106+
assert "age" in tool.parameters["properties"]["user"]["properties"]
105107
assert "flag" in tool.parameters["properties"]
106108

107109
def test_add_callable_object(self):

0 commit comments

Comments
 (0)