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]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
Fixing tests
yuneng-jiangd9bcc33ba70b
diff --git a/tests/test_litellm/proxy/discovery_endpoints/test_ui_discovery_endpoints.py b/tests/test_litellm/proxy/discovery_endpoints/test_ui_discovery_endpoints.pyindex 1d31d4f7bf1..88d31e993dd 100644--- a/tests/test_litellm/proxy/discovery_endpoints/test_ui_discovery_endpoints.py+++ b/tests/test_litellm/proxy/discovery_endpoints/test_ui_discovery_endpoints.py@@ -21,7 +21,7 @@ def test_ui_discovery_endpoints_with_defaults():with patch("litellm.proxy.utils.get_server_root_path", return_value="/"), \patch("litellm.proxy.utils.get_proxy_base_url", return_value=None), \patch("litellm.proxy.auth.auth_utils._has_user_setup_sso", return_value=False), \- patch.dict(os.environ, {}, clear=False):+ patch.dict(os.environ, {"DISABLE_ADMIN_UI": "false"}, clear=False):response = client.get("/.well-known/litellm-ui-config")@@ -41,7 +41,7 @@ def test_ui_discovery_endpoints_with_custom_server_root_path():with patch("litellm.proxy.utils.get_server_root_path", return_value="/litellm"), \patch("litellm.proxy.utils.get_proxy_base_url", return_value=None), \patch("litellm.proxy.auth.auth_utils._has_user_setup_sso", return_value=False), \- patch.dict(os.environ, {}, clear=False):+ patch.dict(os.environ, {"DISABLE_ADMIN_UI": "false"}, clear=False):response = client.get("/.well-known/litellm-ui-config")@@ -60,7 +60,7 @@ def test_ui_discovery_endpoints_with_proxy_base_url_when_set():with patch("litellm.proxy.utils.get_server_root_path", return_value="/"), \patch("litellm.proxy.utils.get_proxy_base_url", return_value="https://proxy.example.com"), \patch("litellm.proxy.auth.auth_utils._has_user_setup_sso", return_value=False), \- patch.dict(os.environ, {}, clear=False):+ patch.dict(os.environ, {"DISABLE_ADMIN_UI": "false"}, clear=False):response = client.get("/litellm/.well-known/litellm-ui-config")@@ -79,7 +79,7 @@ def test_ui_discovery_endpoints_with_sso_configured_and_auto_redirect_enabled():with patch("litellm.proxy.utils.get_server_root_path", return_value="/litellm"), \patch("litellm.proxy.utils.get_proxy_base_url", return_value="https://proxy.example.com"), \patch("litellm.proxy.auth.auth_utils._has_user_setup_sso", return_value=True), \- patch.dict(os.environ, {"AUTO_REDIRECT_UI_LOGIN_TO_SSO": "true"}, clear=False):+ patch.dict(os.environ, {"AUTO_REDIRECT_UI_LOGIN_TO_SSO": "true", "DISABLE_ADMIN_UI": "false"}, clear=False):response = client.get("/.well-known/litellm-ui-config")@@ -98,7 +98,7 @@ def test_ui_discovery_endpoints_with_sso_configured_but_auto_redirect_disabled()with patch("litellm.proxy.utils.get_server_root_path", return_value="/litellm"), \patch("litellm.proxy.utils.get_proxy_base_url", return_value="https://proxy.example.com"), \patch("litellm.proxy.auth.auth_utils._has_user_setup_sso", return_value=True), \- patch.dict(os.environ, {"AUTO_REDIRECT_UI_LOGIN_TO_SSO": "false"}, clear=False):+ patch.dict(os.environ, {"AUTO_REDIRECT_UI_LOGIN_TO_SSO": "false", "DISABLE_ADMIN_UI": "false"}, clear=False):response = client.get("/.well-known/litellm-ui-config")@@ -117,7 +117,7 @@ def test_ui_discovery_endpoints_with_sso_not_configured_but_auto_redirect_enablewith patch("litellm.proxy.utils.get_server_root_path", return_value="/"), \patch("litellm.proxy.utils.get_proxy_base_url", return_value=None), \patch("litellm.proxy.auth.auth_utils._has_user_setup_sso", return_value=False), \- patch.dict(os.environ, {"AUTO_REDIRECT_UI_LOGIN_TO_SSO": "true"}, clear=False):+ patch.dict(os.environ, {"AUTO_REDIRECT_UI_LOGIN_TO_SSO": "true", "DISABLE_ADMIN_UI": "false"}, clear=False):response = client.get("/.well-known/litellm-ui-config")@@ -136,7 +136,7 @@ def test_ui_discovery_endpoints_both_routes_return_same_data():with patch("litellm.proxy.utils.get_server_root_path", return_value="/litellm"), \patch("litellm.proxy.utils.get_proxy_base_url", return_value="https://proxy.example.com"), \patch("litellm.proxy.auth.auth_utils._has_user_setup_sso", return_value=True), \- patch.dict(os.environ, {"AUTO_REDIRECT_UI_LOGIN_TO_SSO": "true"}, clear=False):+ patch.dict(os.environ, {"AUTO_REDIRECT_UI_LOGIN_TO_SSO": "true", "DISABLE_ADMIN_UI": "false"}, clear=False):response1 = client.get("/.well-known/litellm-ui-config")response2 = client.get("/litellm/.well-known/litellm-ui-config")