litellm/tests/test_litellm/proxy
Alexsander Hamir 2e7b554747
3[Fix] CI/CD - logging_testing (#18204)
* fix: enforce team member budget check in common_checks

- Add missing team member budget validation in common_checks() function
  - Checks team membership budget when team key is used
  - Raises BudgetExceededError when team member spend exceeds max_budget_in_team
  - Follows same pattern as other budget checks (team, user, end_user)
  - Uses cached get_team_membership() for performance

- Fix AttributeError in lowest_tpm_rpm.py
  - Add null check for model_info before accessing .get() method
  - Prevents 'NoneType' object has no attribute 'get' error

- Add unit tests for team member budget enforcement
  - Test budget exceeded scenario
  - Test within budget scenario
  - Test edge cases (no budget, no membership, personal keys)
  - Tests run without requiring proxy server

Fixes failing test: test_users_in_team_budget

* fix: mock get_async_httpx_client in test_langsmith_key_based_logging

- Mock get_async_httpx_client to return a mock AsyncHTTPHandler instance
- Fixes test failure where mock_post was never called
- LangsmithLogger creates its own httpx client instance via get_async_httpx_client,
  so we need to mock the factory function rather than the class method
- Use MagicMock for response.raise_for_status (sync method) instead of AsyncMock

* fix: resolve linting errors (PLR0915, F401)

- Remove unused imports (datetime, ServiceLoggerPayload) from arize_phoenix.py
- Extract health ping setup logic from RedisCache.__init__ to reduce statement count
- Extract team member budget check from common_checks to reduce statement count

* fix: resolve type errors in ChatCompletionToolCallChunk construction

- Cast type field to Literal['function'] to satisfy TypedDict requirements
- Ensure arguments field is explicitly str type to match TypedDict signature
- Fixes pyright errors for incompatible types in transformation.py
2025-12-18 10:52:24 -08:00
..
_experimental/mcp_server fix: prefer _get_key_object_permission for key lookups and remove redundant checks 2025-12-18 09:50:56 +09:00
agent_endpoints Merge pull request #17781 from BerriAI/litellm_daily_agent_table 2025-12-11 15:01:50 -08:00
anthropic_endpoints
auth 3[Fix] CI/CD - logging_testing (#18204) 2025-12-18 10:52:24 -08:00
client add a new feature fix to expose the team alias when authenticating th… (#17725) 2025-12-10 10:10:28 -08:00
common_utils Working setting generic callbacks on UI 2025-12-05 14:37:48 -08:00
db Merge pull request #16764 from BerriAI/litellm_tag_spend_dedupe 2025-12-11 15:20:16 -08:00
discovery_endpoints Change is_sso_configured to auto_redirect_to_sso 2025-12-03 15:48:50 -08:00
experimental/mcp_server
google_endpoints fix: Preserve systemInstructions for vertex ai generate content request 2025-12-11 09:52:32 +05:30
guardrails [Fix] CI/CD #1 - mypy | check_code_and_doc_quality | guardrails_testing (#18195) 2025-12-18 06:31:01 -08:00
health_endpoints Merge remote-tracking branch 'origin' into litellm_ui_model_test_connection_fix 2025-12-15 21:07:32 -08:00
hooks feat: allow per-team Vault overrides when storing keys 2025-12-18 06:21:53 +09:00
image_endpoints
management_endpoints Merge pull request #17559 from BerriAI/litellm_new_user_collision_handling 2025-12-17 19:19:41 -08:00
management_helpers
middleware
openai_files_endpoint Merge pull request #17758 from BerriAI/litellm_managed_files_target_storage 2025-12-12 22:26:34 +05:30
pass_through_endpoints Revert "fix(proxy): extract model from vertex ai passthrough url pattern (#17…" 2025-12-16 21:44:10 +05:30
prompts
public_endpoints
response_api_endpoints Fix x-litellm-key-spend update 2025-12-12 11:44:51 +05:30
spend_tracking Fixing tests 2025-12-16 12:51:44 -08:00
test_configs
ui_crud_endpoints Merge pull request #17668 from BerriAI/litellm_sso_config_2 2025-12-11 15:17:33 -08:00
vector_store_endpoints Fix vector store configuration synchronization failure 2025-12-05 11:46:14 +05:30
__init__.py
conftest.py Add health endpoint tests to CI with database and Redis support (#17877) 2025-12-12 07:35:50 -08:00
test_batch_metadata_none_fix.py
test_caching_routes.py
test_common_request_processing.py Fix x-litellm-key-spend update 2025-12-12 11:44:51 +05:30
test_custom_proxy.py
test_enforce_user_param.py Enforce support of enforce_user_param to openai post endpoints 2025-12-03 12:19:21 +05:30
test_fastapi_offline_routes.py
test_health_check_functions.py Add background health checks to db 2025-12-05 14:27:37 +05:30
test_litellm_pre_call_utils.py
test_model_id_header_propagation.py
test_proxy_cli.py
test_proxy_server.py Adding tests 2025-12-17 16:28:15 -08:00
test_proxy_types.py
test_proxy_utils.py
test_route_llm_request.py
test_shared_health_check.py
test_spend_log_cleanup.py
test_swagger_chat_completions.py
test_team_member_update.py