mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-13 02:19:54 +00:00
Beta 3 (#884)
* Rework middlewares, separate management to `MiddlewareManager` class * Rework middlewares * Added changes description for redis * Added changes description for redis * Fixed tests with Redis // aioredis replacement * Changed msg.<html/md>_text attributes behaviour * Added changelog for spoilers * Added possibility to get command magic result as handler arguments
This commit is contained in:
parent
930bca0876
commit
286cf39c8a
51 changed files with 1380 additions and 804 deletions
|
|
@ -74,7 +74,22 @@ class TestDispatcher:
|
|||
|
||||
assert dp.update.handlers
|
||||
assert dp.update.handlers[0].callback == dp._listen_update
|
||||
assert dp.update.outer_middlewares
|
||||
assert dp.update.outer_middleware
|
||||
|
||||
def test_data_bind(self):
|
||||
dp = Dispatcher()
|
||||
assert dp.get("foo") is None
|
||||
assert dp.get("foo", 42) == 42
|
||||
|
||||
dp["foo"] = 1
|
||||
assert dp._data["foo"] == 1
|
||||
assert dp["foo"] == 1
|
||||
|
||||
del dp["foo"]
|
||||
assert "foo" not in dp._data
|
||||
|
||||
def test_storage_property(self, dispatcher: Dispatcher):
|
||||
assert dispatcher.storage is dispatcher.fsm.storage
|
||||
|
||||
def test_parent_router(self, dispatcher: Dispatcher):
|
||||
with pytest.raises(RuntimeError):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue