mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-16 09:22:22 +00:00
test(proxy): build the transcription file-cap test on a real router so it holds after the router refactor
This commit is contained in:
parent
7c75bc78f4
commit
8ce7767bdf
1 changed files with 6 additions and 2 deletions
|
|
@ -16,6 +16,7 @@ import httpx
|
|||
import pytest
|
||||
from fastapi import HTTPException
|
||||
|
||||
from litellm import Router
|
||||
from litellm.proxy import proxy_server
|
||||
from litellm.proxy._types import ProxyErrorTypes, ProxyException
|
||||
from litellm.types.llms.openai import HttpxBinaryResponseContent
|
||||
|
|
@ -257,9 +258,12 @@ def test_audio_transcription_over_the_file_size_cap_is_rejected_as_a_bad_request
|
|||
):
|
||||
from litellm.proxy.common_utils.http_parsing_utils import check_file_size_under_limit
|
||||
|
||||
proxy_server.llm_router.get_deployment_by_model_group_name.return_value = MagicMock(
|
||||
litellm_params=MagicMock(max_file_size_mb=0.000001)
|
||||
capped_router = Router(
|
||||
model_list=[
|
||||
{"model_name": "whisper-1", "litellm_params": {"model": "openai/whisper-1", "max_file_size_mb": 0.000001}}
|
||||
]
|
||||
)
|
||||
monkeypatch.setattr(proxy_server, "llm_router", capped_router)
|
||||
monkeypatch.setattr(proxy_server, "premium_user", True)
|
||||
monkeypatch.setattr(proxy_server, "check_file_size_under_limit", check_file_size_under_limit)
|
||||
files = {"file": ("audio.mp3", b"\x00\x01\x02", "audio/mpeg")}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue