litellm/tests/proxy_unit_tests
Alexsander Hamir 5b6b613561
[Fix] CI/CD - Fix failing proxy unit test and langfuse trace_id test (#17924)
* fix: correct Request headers format in JWT auth test

Fix test_jwt_non_admin_team_route_access by converting headers to bytes
format as required by Starlette's ASGI specification. Headers must be
bytes tuples with lowercase header names.

This allows dict(request.headers) to work correctly and enables the
authorization check to run, producing the expected error message.

* fix: ignore UUID trace_id from standard_logging_object, use litellm_call_id

The issue was that standard_logging_object.trace_id contains a UUID
(from litellm_trace_id default), which was being used instead of
falling back to litellm_call_id. This caused the test to fail because
it expected 'my-unique-call-id' but got a UUID.

Now we properly detect UUIDs (36 chars with 4 hyphens in specific positions)
and ignore them, allowing the fallback to litellm_call_id to work correctly.
This ensures we use litellm_call_id when no explicit trace_id is provided,
which gets stored in the cache and returned by _get_trace_id().

* fix: use existing_trace_id when provided instead of litellm_call_id

When existing_trace_id is provided in metadata, it should be used as the
trace_id to return (and store in cache), not litellm_call_id. This fixes
the test case where existing_trace_id is set and should be returned by
_get_trace_id().
2025-12-13 09:32:43 -08:00
..
example_config_yaml fix tests 2025-10-25 10:19:24 -07:00
test_configs fix tests 2025-10-25 10:19:24 -07:00
test_model_response_typing
adroit-crow-413218-bc47f303efc9.json
azure_fine_tune.jsonl
batch_job_results_furniture.jsonl
conftest copy.py
conftest.py
data_map.txt
eagle.wav
gettysburg.wav
large_text.py
messages_with_counts.py
model_cost.json
openai_batch_completions_router.jsonl
openai_batch_completions.jsonl
speech_vertex.mp3
test_aproxy_startup.py
test_audit_logs_proxy.py
test_auth_checks.py
test_banned_keyword_list.py
test_custom_callback_input.py
test_custom_logger_s3_gcs.py
test_custom_tokenizer_bug.py fix(token-counter): extract model_info from deployment for custom_tokenizer (#15657) (#15680) 2025-10-17 19:38:45 -07:00
test_db_schema_changes.py
test_db_schema_migration.py
test_default_end_user_budget_simple.py [AI Gateway] - End User Budgets - Allow pointing max_end_user budget to an id, so the default ID applies to all end users (#16456) 2025-11-11 08:20:13 -08:00
test_deployed_proxy_keygen.py
test_e2e_pod_lock_manager.py
test_google_endpoint_routing.py Support model names with slashes on Gemini endpoints (#17743) 2025-12-09 18:40:51 -08:00
test_google_gemini_proxy_request.py Fix: Send Gemini API key via x-goog-api-key header with custom api_base (#16085) 2025-11-05 07:12:13 -08:00
test_jwt.py test fixes 2025-12-05 17:12:01 -08:00
test_key_generate_dynamodb.py
test_key_generate_prisma.py [Fix] CI/CD – Clean Up Performance PR Changes & others (#17838) 2025-12-11 12:50:03 -08:00
test_models_fallback_endpoint.py
test_prisma_client_backoff_retry.py
test_prompt_test_endpoint.py [Feat] UI - Prompt Management - Allow testing prompts with Chat UI (#16898) 2025-11-21 08:53:18 -08:00
test_proxy_config_unit_test.py
test_proxy_custom_auth.py
test_proxy_custom_logger.py
test_proxy_encrypt_decrypt.py
test_proxy_exception_mapping.py [Perf] Embeddings: Use router's O(1) lookup and shared sessions (#16344) 2025-11-14 09:21:45 -08:00
test_proxy_gunicorn.py
test_proxy_pass_user_config.py fix tests 2025-10-25 10:19:24 -07:00
test_proxy_reject_logging.py
test_proxy_routes.py
test_proxy_server_caching.py
test_proxy_server_keys.py fix tests 2025-10-25 10:19:24 -07:00
test_proxy_server_langfuse.py
test_proxy_server_spend.py
test_proxy_server.py fixing tests 2025-12-06 21:23:49 -08:00
test_proxy_setting_guardrails.py
test_proxy_token_counter.py test_vertex_ai_partner_models_token_counting_endpoint 2025-11-26 11:37:55 -08:00
test_proxy_utils.py [Fix] CI/CD – Clean Up Performance PR Changes & others (#17838) 2025-12-11 12:50:03 -08:00
test_realtime_cache.py [Perf] Fix bottlenecks degrading realtime endpoint performance (#16670) 2025-11-22 10:01:02 -08:00
test_response_polling_handler.py Fix flanky tests (#17665) 2025-12-08 12:21:26 -08:00
test_search_api_logging.py Add cost tracking and logging support 2025-11-25 17:14:59 +05:30
test_unit_test_max_model_budget_limiter.py
test_unit_test_proxy_hooks.py [Fix] CI/CD – Clean Up Performance PR Changes & others (#17838) 2025-12-11 12:50:03 -08:00
test_update_spend.py [Fix] CI/CD – Clean Up Performance PR Changes & others (#17838) 2025-12-11 12:50:03 -08:00
test_user_api_key_auth.py [Fix] CI/CD - Fix failing proxy unit test and langfuse trace_id test (#17924) 2025-12-13 09:32:43 -08:00
vertex_key.json