mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-17 09:34:48 +00:00
test(proxy): construct dynamic rate limiter v3 through __init__ in raise-branch test
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
parent
0f30d572b2
commit
55a179ae7b
1 changed files with 2 additions and 5 deletions
|
|
@ -767,16 +767,13 @@ class TestProxyHooksActuallyRaiseProxyRateLimitError:
|
|||
"""
|
||||
from unittest.mock import AsyncMock, MagicMock
|
||||
|
||||
from litellm.caching.caching import DualCache
|
||||
from litellm.proxy._types import UserAPIKeyAuth
|
||||
from litellm.proxy.hooks.dynamic_rate_limiter_v3 import (
|
||||
_PROXY_DynamicRateLimitHandlerV3,
|
||||
)
|
||||
|
||||
# Bypass __init__ — we want to inject a stub v3_limiter without
|
||||
# paying for the full handler setup.
|
||||
handler = _PROXY_DynamicRateLimitHandlerV3.__new__(
|
||||
_PROXY_DynamicRateLimitHandlerV3
|
||||
)
|
||||
handler = _PROXY_DynamicRateLimitHandlerV3(internal_usage_cache=DualCache())
|
||||
v3_limiter = MagicMock()
|
||||
v3_limiter.window_size = 60
|
||||
v3_limiter.atomic_check_and_increment_by_n = AsyncMock(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue