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: repair three failing suites on litellm_internal_staging

Yuneng Jiangb6557d2b14f7
diff --git a/tests/enterprise/litellm_enterprise/enterprise_callbacks/test_prometheus_logging_callbacks.py b/tests/enterprise/litellm_enterprise/enterprise_callbacks/test_prometheus_logging_callbacks.py
index 9acb87750e9..b6c9cd0294b 100644
--- a/tests/enterprise/litellm_enterprise/enterprise_callbacks/test_prometheus_logging_callbacks.py
+++ b/tests/enterprise/litellm_enterprise/enterprise_callbacks/test_prometheus_logging_callbacks.py
@@ -1741,26 +1741,16 @@ async def test_initialize_remaining_budget_metrics_exception_handling(
# Verify all five errors were logged (teams, keys, users, orgs, and user/team count)
assert mock_logger.call_count == 5
- assert (
- "Error initializing teams budget metrics"
- in mock_logger.call_args_list[0][0][0]
- )
- assert (
- "Error initializing keys budget metrics"
- in mock_logger.call_args_list[1][0][0]
- )
- assert (
- "Error initializing users budget metrics"
- in mock_logger.call_args_list[2][0][0]
- )
- assert (
- "Error initializing orgs budget metrics"
- in mock_logger.call_args_list[3][0][0]
- )
- assert (
- "Error initializing user/team count metrics"
- in mock_logger.call_args_list[4][0][0]
- )
+ logged = [
+ call.args[0] % call.args[1:] for call in mock_logger.call_args_list
+ ]
+ assert logged == [
+ "Error initializing teams budget metrics: Database error",
+ "Error initializing keys budget metrics: Key listing error",
+ "Error initializing users budget metrics: User database error",
+ "Error initializing orgs budget metrics: Org database error",
+ "Error initializing user/team count metrics: User count error",
+ ]
# Verify the metrics were never called
prometheus_logger.litellm_remaining_team_budget_metric.assert_not_called()
diff --git a/tests/local_testing/test_completion.py b/tests/local_testing/test_completion.py
index 616d8b94e6a..b4f0359cf9d 100644
--- a/tests/local_testing/test_completion.py
+++ b/tests/local_testing/test_completion.py
@@ -213,36 +213,6 @@ def test_completion_empower():
pytest.fail(f"Error occurred: {e}")
-def test_completion_github_api():
- litellm.set_verbose = True
- messages = [
- {
- "role": "user",
- "content": "\nWhat is the query for `console.log` => `console.error`\n",
- },
- {
- "role": "assistant",
- "content": "\nThis is the GritQL query for the given before/after examples:\n<gritql>\n`console.log` => `console.error`\n</gritql>\n",
- },
- {
- "role": "user",
- "content": "\nWhat is the query for `console.info` => `consdole.heaven`\n",
- },
- ]
- try:
- # test without max tokens
- response = completion(
- model="github/gpt-4o",
- messages=messages,
- )
- # Add any assertions, here to check response args
- print(response)
- except litellm.AuthenticationError:
- pass
- except Exception as e:
- pytest.fail(f"Error occurred: {e}")
-
-
def test_completion_claude_3_empty_response():
litellm.set_verbose = True
diff --git a/tests/proxy_behavior/management/test_team_metadata_schema.py b/tests/proxy_behavior/management/test_team_metadata_schema.py
new file mode 100644
index 00000000000..c1d308eba33
--- /dev/null
+++ b/tests/proxy_behavior/management/test_team_metadata_schema.py
@@ -0,0 +1,25 @@
+"""GET /team/metadata_schema — the behavior world declares no
+``general_settings.team_metadata_schema``, so the route is an info route that
+returns an empty field list to every authenticated actor and 401s without a key.
+"""
+
+import pytest
+
+from .actors import Actor
+
+pytestmark = pytest.mark.asyncio(loop_scope="session")
+
+
[email protected]("actor", list(Actor), ids=[a.value for a in Actor])
+async def test_team_metadata_schema_default_is_empty(actor: Actor, proxy_client, world):
+ resp = await proxy_client.get(
+ "/team/metadata_schema",
+ headers={"Authorization": f"Bearer {world.keys[actor].cleartext}"},
+ )
+ assert resp.status_code == 200, f"{actor.value}: {resp.status_code} {resp.text}"
+ assert resp.json() == {"fields": []}
+
+
+async def test_team_metadata_schema_requires_auth(proxy_client, world):
+ resp = await proxy_client.get("/team/metadata_schema")
+ assert resp.status_code == 401, resp.text