Added possibility to use empty callback data factory filter

This commit is contained in:
Alex Root Junior 2021-07-29 00:05:15 +03:00
parent 7d56751b09
commit 5e3356fa62
3 changed files with 13 additions and 5 deletions

View file

@ -42,6 +42,10 @@ async def redis_storage(redis_server):
if not redis_server:
pytest.skip("Redis is not available here")
storage = RedisStorage.from_url(redis_server)
try:
await storage.redis.info()
except ConnectionError as e:
pytest.skip(str(e))
try:
yield storage
finally:

View file

@ -156,7 +156,11 @@ class TestCallbackDataFilter:
["test", F.foo == "test", False],
["test:spam:42", F.foo == "test", False],
["test:test:42", F.foo == "test", {"callback_data": MyCallback(foo="test", bar=42)}],
["test:test:42", None, {"callback_data": MyCallback(foo="test", bar=42)}],
["test:test:777", None, {"callback_data": MyCallback(foo="test", bar=777)}],
["spam:test:777", None, False],
["test:test:", F.foo == "test", False],
["test:test:", None, False],
],
)
@pytest.mark.asyncio