mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-07 07:58:09 +00:00
test(fallback): key the refused-DEL Redis double by cache key
This commit is contained in:
parent
1341a05781
commit
d85848667a
1 changed files with 5 additions and 5 deletions
|
|
@ -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")
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue