mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
implement POC of "smart defaults", pin newest pydantic 1.5.1 (resolves issue with BaseFilter signature inspection)
17 lines
406 B
Python
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):
|
|
...
|