mirror of
https://github.com/BerriAI/litellm.git
synced 2026-08-28 05:25:59 +00:00
test: add explicit mock verification in test_provider_support
- Capture mock handler with 'as mock_handler' for explicit validation - Add assert_called_once() to verify mock was actually used - Ensures test verifies no real API calls are made - Follows same pattern as test_openai_env_base validation
This commit is contained in:
parent
0dd2193b4c
commit
b6a11fcc78
1 changed files with 3 additions and 1 deletions
|
|
@ -385,10 +385,12 @@ class TestContainerIntegration:
|
|||
name="Provider Test Container"
|
||||
)
|
||||
|
||||
with patch.object(litellm.main.base_llm_http_handler, 'container_create_handler', return_value=mock_response):
|
||||
with patch.object(litellm.main.base_llm_http_handler, 'container_create_handler', return_value=mock_response) as mock_handler:
|
||||
response = create_container(
|
||||
name="Provider Test Container",
|
||||
custom_llm_provider=provider
|
||||
)
|
||||
|
||||
assert response.name == "Provider Test Container"
|
||||
# Verify the mock was actually called (not making real API calls)
|
||||
mock_handler.assert_called_once()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue