mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-23 22:14:18 +02:00
Fix transform arg collisions with passthrough params (#3431)
🤖 Generated with GPT-5.2-Codex
This commit is contained in:
parent
901d8cdd60
commit
d316f193a8
2 changed files with 24 additions and 6 deletions
|
|
@ -482,6 +482,20 @@ def test_transform_args_creates_duplicate_names(add_tool):
|
|||
)
|
||||
|
||||
|
||||
def test_transform_args_collision_with_passthrough_name(add_tool):
|
||||
"""Test that renaming to a passthrough parameter name raises ValueError."""
|
||||
with pytest.raises(
|
||||
ValueError,
|
||||
match="Multiple arguments would be mapped to the same names: old_y",
|
||||
):
|
||||
Tool.from_tool(
|
||||
add_tool,
|
||||
transform_args={
|
||||
"old_x": ArgTransform(name="old_y"),
|
||||
},
|
||||
)
|
||||
|
||||
|
||||
def test_function_without_kwargs_missing_params(add_tool):
|
||||
"""Test that function missing required transformed parameters raises ValueError."""
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue