aiogram/tests/test_dispatcher/test_requirement.py
mpa 32ffda2eb7
feat(handler): requirement class
implement POC of "smart defaults", pin newest pydantic 1.5.1 (resolves
issue with BaseFilter signature inspection)
2020-05-27 12:22:22 +04:00

17 lines
406 B
Python

# todo
from aiogram.dispatcher.requirement import require, CallableRequirement
tick_data = {"ticks": 0}
def test_require():
x = require(lambda: "str", use_cache=True, cache_key=0)
assert isinstance(x, CallableRequirement)
assert callable(x) & callable(x.callable)
assert x.cache_key == 0
assert x.use_cache
class TestCallableRequirementCache:
def test_cache(self):
...