Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

test fix - router utils

Ishaan Jaffd8dc84ee9621
diff --git a/tests/router_unit_tests/test_router_helper_utils.py b/tests/router_unit_tests/test_router_helper_utils.py
index 99fcd551f4d..19d2bec124b 100644
--- a/tests/router_unit_tests/test_router_helper_utils.py
+++ b/tests/router_unit_tests/test_router_helper_utils.py
@@ -1242,37 +1242,3 @@ def test_mock_router_testing_params_str_to_bool_conversion(
# Verify other params remain unchanged
assert kwargs["other_param"] == "should_remain"
-
- "fallback_kwarg_value, expected_error",
- [
- # Test string values that should convert to True and trigger exceptions
- ("true", litellm.InternalServerError),
- ("TRUE", litellm.InternalServerError),
- ("1", litellm.InternalServerError),
- ("yes", litellm.InternalServerError),
- # Test string values that should convert to False and not trigger exceptions
- ("false", None),
- ("FALSE", None),
- ("0", None),
- ("no", None),
- # Test actual boolean values
- (True, litellm.InternalServerError),
- (False, None),
- ],
-)
-def test_handle_mock_testing_fallbacks_with_str_to_bool_integration(model_list, fallback_kwarg_value, expected_error):
- """Test if the router's _handle_mock_testing_fallbacks correctly handles str_to_bool conversion from MockRouterTestingParams"""
- router = Router(model_list=model_list)
-
- kwargs = {
- "mock_testing_fallbacks": fallback_kwarg_value,
- }
-
- if expected_error:
- with pytest.raises(expected_error):
- router._handle_mock_testing_fallbacks(kwargs=kwargs)
- else:
- # Should not raise any exception
- router._handle_mock_testing_fallbacks(kwargs=kwargs)
- # If we get here, no exception was raised, which is expected