mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-10 17:53:17 +00:00
Merge BaseBot to Bot class
This commit is contained in:
parent
fac69e52b7
commit
a823e275a7
6 changed files with 111 additions and 120 deletions
|
|
@ -23,7 +23,6 @@ class TestBaseClassBasedHandler:
|
|||
|
||||
assert handler.event == event
|
||||
assert handler.data["key"] == 42
|
||||
assert hasattr(handler, "bot")
|
||||
assert not hasattr(handler, "filters")
|
||||
assert await handler == 42
|
||||
|
||||
|
|
@ -33,7 +32,8 @@ class TestBaseClassBasedHandler:
|
|||
handler = MyHandler(event=event, key=42)
|
||||
bot = Bot("42:TEST")
|
||||
|
||||
assert handler.bot is None
|
||||
with pytest.raises(LookupError):
|
||||
handler.bot
|
||||
|
||||
Bot.set_current(bot)
|
||||
assert handler.bot == bot
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue