From d85848667ab506349474ec458e7fbc6c2d101978 Mon Sep 17 00:00:00 2001 From: mateo-berri <277851410+mateo-berri@users.noreply.github.com> Date: Thu, 29 Oct 2026 03:45:14 -0700 Subject: [PATCH] test(fallback): key the refused-DEL Redis double by cache key --- tests/unit/proxy/test_fallback_management_endpoints.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/unit/proxy/test_fallback_management_endpoints.py b/tests/unit/proxy/test_fallback_management_endpoints.py index 75efa9680cf..77a204d32ea 100644 --- a/tests/unit/proxy/test_fallback_management_endpoints.py +++ b/tests/unit/proxy/test_fallback_management_endpoints.py @@ -10,8 +10,8 @@ Tests: import copy import json -from collections.abc import AsyncIterator -from types import SimpleNamespace +from collections.abc import AsyncIterator, Mapping +from types import MappingProxyType, SimpleNamespace from typing import Final, get_args from unittest.mock import AsyncMock, MagicMock, patch @@ -326,13 +326,13 @@ NON_STANDARD_RULES: Final = [ class _RedisThatRefusesDel: def __init__(self) -> None: - self.value: object = None + self.values: Mapping[str, object] = MappingProxyType({}) async def async_get_cache(self, key: str, parent_otel_span: object = None) -> object: - return self.value + return self.values.get(key) async def async_set_cache(self, key: str, value: object, **_: object) -> None: - self.value = value + self.values = MappingProxyType({**self.values, key: value}) async def async_delete_cache(self, key: str) -> None: raise NoPermissionError("this user has no permissions to run the 'del' command")