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_health_check_not_called_when_disabled

Ishaan Jaffer35c636ba9795
diff --git a/tests/proxy_unit_tests/test_proxy_server.py b/tests/proxy_unit_tests/test_proxy_server.py
index 8d3b0fee48f..0db1240544a 100644
--- a/tests/proxy_unit_tests/test_proxy_server.py
+++ b/tests/proxy_unit_tests/test_proxy_server.py
@@ -642,8 +642,8 @@ def test_embedding(mock_aembedding, client_no_auth):
during_call_kwargs = mock_during_hook.await_args_list[0].kwargs
assert (
- during_call_kwargs.get("call_type") == "embeddings"
- ), f"expected during_call_hook to receive call_type='embeddings', got {during_call_kwargs.get('call_type')}"
+ during_call_kwargs.get("call_type") == "embedding"
+ ), f"expected during_call_hook to receive call_type='embedding', got {during_call_kwargs.get('call_type')}"
except Exception as e:
pytest.fail(f"LiteLLM Proxy test failed. Exception - {str(e)}")
@@ -2185,6 +2185,10 @@ async def test_proxy_server_prisma_setup():
mock_client._set_spend_logs_row_count_in_proxy_state = (
AsyncMock()
) # Mock the _set_spend_logs_row_count_in_proxy_state method
+ # Mock the db attribute with start_token_refresh_task for RDS IAM token refresh
+ mock_db = MagicMock()
+ mock_db.start_token_refresh_task = AsyncMock()
+ mock_client.db = mock_db
await ProxyStartupEvent._setup_prisma_client(
database_url=os.getenv("DATABASE_URL"),
diff --git a/tests/proxy_unit_tests/test_proxy_utils.py b/tests/proxy_unit_tests/test_proxy_utils.py
index 5c3c3948920..64f1ec24234 100644
--- a/tests/proxy_unit_tests/test_proxy_utils.py
+++ b/tests/proxy_unit_tests/test_proxy_utils.py
@@ -1574,6 +1574,10 @@ async def test_health_check_not_called_when_disabled(monkeypatch):
mock_prisma.health_check = AsyncMock()
mock_prisma.check_view_exists = AsyncMock()
mock_prisma._set_spend_logs_row_count_in_proxy_state = AsyncMock()
+ # Mock the db attribute with start_token_refresh_task for RDS IAM token refresh
+ mock_db = MagicMock()
+ mock_db.start_token_refresh_task = AsyncMock()
+ mock_prisma.db = mock_db
# Mock PrismaClient constructor
monkeypatch.setattr(
"litellm.proxy.proxy_server.PrismaClient", lambda **kwargs: mock_prisma