mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-20 00:11:50 +00:00
test(e2e): validate the captured /model/new body with its pydantic model
This commit is contained in:
parent
dcde8395ec
commit
185a712d24
1 changed files with 5 additions and 3 deletions
|
|
@ -40,6 +40,7 @@ from models import (
|
|||
KeyInfoResponse,
|
||||
KeyUpdateBody,
|
||||
LiteLLMParamsBody,
|
||||
ModelNewBody,
|
||||
McpServerCreateBody,
|
||||
McpServerUpdateBody,
|
||||
ModelListEntry,
|
||||
|
|
@ -609,9 +610,10 @@ def test_registration_binds_the_deployment_to_this_test_unless_it_is_provider_li
|
|||
)
|
||||
finally:
|
||||
configured_cache.cache_clear()
|
||||
params: Final = json.loads(bodies.get_nowait())["litellm_params"]
|
||||
sent: Final = ModelNewBody.model_validate_json(bodies.get_nowait())
|
||||
assert bodies.empty()
|
||||
if provider_live:
|
||||
assert params.get("api_base") is None
|
||||
assert sent.litellm_params.api_base is None
|
||||
return
|
||||
assert params["api_base"].endswith(f"/openai/t/{slug_for_test(current_test_key())}/v1")
|
||||
assert sent.litellm_params.api_base is not None
|
||||
assert sent.litellm_params.api_base.endswith(f"/openai/t/{slug_for_test(current_test_key())}/v1")
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue