From 58a1f3a8f7b6bac21b8e181670c61ff733d15cc1 Mon Sep 17 00:00:00 2001 From: Esteban Zeller Date: Thu, 26 Feb 2026 16:37:57 -0300 Subject: [PATCH] Refactor test for map_openai_params function Removed test case for drop_params=False that checked for UnsupportedParamsError on unknown_param, while preserving tools. --- .../chat/test_gradient_ai_chat_transformation.py | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/tests/litellm/llms/gradient_ai/chat/test_gradient_ai_chat_transformation.py b/tests/litellm/llms/gradient_ai/chat/test_gradient_ai_chat_transformation.py index 92eb1ef8cc9..1904035f3ec 100644 --- a/tests/litellm/llms/gradient_ai/chat/test_gradient_ai_chat_transformation.py +++ b/tests/litellm/llms/gradient_ai/chat/test_gradient_ai_chat_transformation.py @@ -124,21 +124,7 @@ def test_map_openai_params_allows_tools_explicitly(config): optional_params = {} - # Case 1: drop_params=False → should raise only on unknown_param, NOT on tools/tool_choice - with pytest.raises(UnsupportedParamsError) as exc_info: - result = config.map_openai_params( - non_default_params=non_default_params, - optional_params=optional_params.copy(), - model="gradient_ai/test-model", - drop_params=False, - ) - - error_msg = str(exc_info.value) - assert "unknown_param" in error_msg - assert "tools" not in error_msg # Important: should NOT complain about tools - assert "tool_choice" not in error_msg - - # Case 2: drop_params=True → should pass without raising and preserve tools + # drop_params=True → should pass without raising and preserve tools result = config.map_openai_params( non_default_params=non_default_params, optional_params=optional_params.copy(),