litellm/tests/test_litellm/proxy/management_endpoints
shin-bot-litellm 1477b4b46b
fix(tests): Add missing mocks for MCP IP filtering and updated APIs (#20652)
Fixes 15 failing tests in the MCP test suite:

1. **OAuth discoverable endpoints** (test_discoverable_endpoints.py):
   - Added autouse fixture to mock IPAddressUtils.get_mcp_client_ip
   - This bypasses IP-based access control which was blocking server lookup
   - Fixes: test_authorize_*, test_token_*, test_oauth_*, test_register_*

2. **A2A endpoints** (test_a2a_endpoints.py):
   - Fixed mock path for add_litellm_data_to_request
   - Was patching litellm_pre_call_utils but function is called from common_request_processing

3. **MCP guardrail handler** (test_mcp_guardrail_handler.py):
   - Updated tests to match new handler behavior
   - Handler now passes tools (not texts) to guardrail
   - Handler checks for mcp_tool_name (not messages array)

4. **MCP path-based segregation** (test_user_api_key_auth_mcp.py):
   - Added client_ip to get_auth_context unpacking (7 values now)
   - get_auth_context was updated to include client_ip

5. **MCP registry** (test_mcp_management_endpoints.py):
   - Added mock for get_filtered_registry (not just get_registry)
   - Registry endpoint uses get_filtered_registry for IP filtering

Co-authored-by: Shin <shin@openclaw.ai>
2026-02-07 11:30:49 -08:00
..
scim feat: add base /scim/v2 endpoint for SCIM resource discovery (#20301) 2026-02-02 14:27:00 -08:00
search_endpoints masking sensitive values 2026-02-03 16:09:37 -08:00
test_access_group_management.py
test_budget_endpoints.py fix mock tests 2026-01-02 21:40:27 +05:30
test_cache_settings_endpoints.py
test_callback_management_endpoints.py
test_common_daily_activity.py Add endpoint to aggregate activity tables 2026-01-06 15:54:03 -08:00
test_cost_tracking_settings.py
test_customer_budget.py
test_customer_endpoints.py Adding tests 2025-12-04 12:36:15 -08:00
test_delete_callbacks_endpoint.py
test_entraid_app_roles.py
test_internal_user_endpoints.py allow max_budget reset 2026-02-03 16:32:21 -08:00
test_key_management_endpoints.py fixing user_id 2026-02-06 17:55:45 -08:00
test_mcp_management_endpoints.py fix(tests): Add missing mocks for MCP IP filtering and updated APIs (#20652) 2026-02-07 11:30:49 -08:00
test_model_management_endpoints.py
test_organization_endpoints.py optional query params for org list 2026-01-10 14:44:28 -08:00
test_router_settings_endpoints.py New endpoint for router fields + react query 2026-01-09 16:49:22 -08:00
test_tag_management_endpoints.py Fix tag management to preserve encrypted fields in litellm_params (#17484) 2025-12-18 02:28:39 +05:30
test_team_endpoints.py Add soft_budget to team table and create update endpoints 2026-02-05 14:43:48 -08:00
test_ui_sso.py fix(sso): extract user roles from JWT access token for Keycloak compatibility (#20591) 2026-02-06 16:05:51 -08:00