tests-fix-1

This commit is contained in:
2025-08-27 02:45:15 +03:00
parent 90aece7a60
commit eef2ae1d5e
9 changed files with 413 additions and 115 deletions

View File

@@ -18,6 +18,19 @@ try:
# Create a fake Redis instance
fake_redis = fakeredis.aioredis.FakeRedis()
# Add the execute method that our Redis service needs
async def execute_method(command: str, *args):
"""Добавляем метод execute для совместимости с RedisService"""
cmd_method = getattr(fake_redis, command.lower(), None)
if cmd_method is not None:
if hasattr(cmd_method, '__call__'):
return await cmd_method(*args)
else:
return cmd_method
return None
fake_redis.execute = execute_method
# Patch Redis at module level
import storage.redis