The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
test(proxy): restore pipeline methods on expiring Redis fake after merge
yassinb415f2263a6b
diff --git a/tests/test_litellm/proxy/test_budget_reservation.py b/tests/test_litellm/proxy/test_budget_reservation.pyindex 6905585fd5e..86bf896188f 100644--- a/tests/test_litellm/proxy/test_budget_reservation.py+++ b/tests/test_litellm/proxy/test_budget_reservation.py@@ -1,7 +1,7 @@import asyncioimport threadingimport time-from collections.abc import Mapping+from collections.abc import Mapping, Sequencefrom datetime import datetime, timedelta, timezonefrom types import SimpleNamespacefrom unittest.mock import AsyncMock, MagicMock, patch@@ -11,6 +11,7 @@ from fastapi import HTTPExceptionimport litellmfrom litellm.caching.dual_cache import DualCache+from litellm.types.caching import RedisPipelineIncrementOperationfrom litellm.constants import STREAM_SSE_KEEPALIVE_PING_BYTESfrom litellm.llms.anthropic.experimental_pass_through.messages.agentic_streaming_iterator import (AgenticAnthropicStreamingIterator,@@ -2400,6 +2401,14 @@ class _ExpiringRedisCache:self.expires_at[key] = time.monotonic() + (ttl if ttl is not None else self.default_ttl)return True+ async def async_increment_pipeline(+ self, increment_list: Sequence[RedisPipelineIncrementOperation], **kwargs: object+ ) -> list[float]:+ return [await self.async_increment(op["key"], op["increment_value"]) for op in increment_list]++ def get_ttl(self, **kwargs: object) -> int | None:+ return int(self.default_ttl)+@pytest.mark.asyncioasync def test_reservation_survives_redis_counter_ttl_while_request_in_flight(@@ -2475,15 +2484,6 @@ async def test_reservation_lease_stops_when_request_task_ends_without_reconcilinassert redis_cache.refresh_count == 0assert await redis_cache.async_get_cache(key=counter_key) is None- async def async_increment_pipeline(self, increment_list, **kwargs):- results = []- for op in increment_list:- results.append(await self.async_increment(op["key"], op["increment_value"]))- return results-- def get_ttl(self, **kwargs) -> None:- return None-class _TeamMembershipFloorDb:"""Stands in for `prisma_client.db`: only the team-membership row exists and its spend is the DB floor."""