mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-24 00:52:24 +00:00
Merge pull request #42131 from BerriAI/litellm_migrate_tests_p16
test: migrate phase 16 legacy tests to tests/unit
This commit is contained in:
commit
8795d5f847
26 changed files with 0 additions and 40 deletions
0
tests/unit/rust_bridge/__init__.py
Normal file
0
tests/unit/rust_bridge/__init__.py
Normal file
0
tests/unit/rust_bridge/ocr/__init__.py
Normal file
0
tests/unit/rust_bridge/ocr/__init__.py
Normal file
0
tests/unit/rust_bridge/responses/__init__.py
Normal file
0
tests/unit/rust_bridge/responses/__init__.py
Normal file
0
tests/unit/sandbox/__init__.py
Normal file
0
tests/unit/sandbox/__init__.py
Normal file
0
tests/unit/skills/__init__.py
Normal file
0
tests/unit/skills/__init__.py
Normal file
0
tests/unit/test_router/__init__.py
Normal file
0
tests/unit/test_router/__init__.py
Normal file
|
|
@ -1039,31 +1039,3 @@ class TestContextSlotRetention:
|
|||
assert deployment is not None
|
||||
router._update_kwargs_with_deployment(deployment=deployment.model_dump(), kwargs=kwargs)
|
||||
assert get_io_token_rate_limit_request_kwargs() is kwargs
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_the_deployment_itpm_reservation_counts_the_request_off_the_event_loop():
|
||||
from litellm.utils import get_utc_datetime
|
||||
from tests.large_text import text
|
||||
from tests.test_litellm.litellm_core_utils.event_loop_lag import (
|
||||
assert_loop_stayed_free,
|
||||
timed_with_loop_lags,
|
||||
warm_tokenizer,
|
||||
)
|
||||
|
||||
dual_cache = DualCache()
|
||||
check = ModelRateLimitingCheck(dual_cache=dual_cache)
|
||||
warm_tokenizer("anthropic/claude-fable-5")
|
||||
deployment = {
|
||||
"litellm_params": {"model": "anthropic/claude-fable-5", "itpm": 10_000_000},
|
||||
"model_info": {"id": "io-loop-id"},
|
||||
"model_name": "claude",
|
||||
}
|
||||
set_io_token_rate_limit_request_kwargs({"messages": [{"role": "user", "content": text * 100}], "metadata": {}})
|
||||
|
||||
_, took, lags = await timed_with_loop_lags(lambda: check.async_pre_call_check(deployment))
|
||||
|
||||
minute = get_utc_datetime().strftime("%H-%M")
|
||||
reserved = await dual_cache.async_get_cache(key=f"global_router:io-loop-id:anthropic/claude-fable-5:itpm:{minute}")
|
||||
assert reserved > 100_000
|
||||
assert_loop_stayed_free(took, lags)
|
||||
0
tests/unit/types/__init__.py
Normal file
0
tests/unit/types/__init__.py
Normal file
0
tests/unit/types/llms/__init__.py
Normal file
0
tests/unit/types/llms/__init__.py
Normal file
0
tests/unit/types/proxy/__init__.py
Normal file
0
tests/unit/types/proxy/__init__.py
Normal file
0
tests/unit/types/proxy/policy_engine/__init__.py
Normal file
0
tests/unit/types/proxy/policy_engine/__init__.py
Normal file
0
tests/unit/videos/__init__.py
Normal file
0
tests/unit/videos/__init__.py
Normal file
|
|
@ -169,18 +169,6 @@ def test_optional__extra_body_overrides_mapped_and_is_removed():
|
|||
assert "extra_body" not in result
|
||||
|
||||
|
||||
def test_optional__no_extra_body_returns_mapped_unchanged():
|
||||
config = _config({"seconds": "8"})
|
||||
|
||||
result = get_optional(
|
||||
model="sora-2",
|
||||
video_generation_provider_config=config,
|
||||
video_generation_optional_params={"seconds": "8"},
|
||||
)
|
||||
|
||||
assert result == {"seconds": "8"}
|
||||
|
||||
|
||||
def test_optional__non_dict_extra_body_ignored():
|
||||
config = _config({"seconds": "8"})
|
||||
|
||||
Loading…
Add table
Reference in a new issue