mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-12 02:03:04 +00:00
Cover Command filter
This commit is contained in:
parent
1cd993009e
commit
9d78e82f8c
7 changed files with 161 additions and 8 deletions
|
|
@ -40,7 +40,7 @@ class TestBaseMessageHandlerCommandMixin:
|
|||
Message(
|
||||
message_id=42,
|
||||
date=datetime.datetime.now(),
|
||||
text="test",
|
||||
text="/test args",
|
||||
chat=Chat(id=42, type="private"),
|
||||
from_user=User(id=42, is_bot=False, first_name="Test"),
|
||||
),
|
||||
|
|
@ -49,3 +49,16 @@ class TestBaseMessageHandlerCommandMixin:
|
|||
|
||||
assert isinstance(handler.command, CommandObject)
|
||||
assert handler.command.command == "command"
|
||||
|
||||
def test_command_not_presented(self):
|
||||
handler = HandlerWithCommand(
|
||||
Message(
|
||||
message_id=42,
|
||||
date=datetime.datetime.now(),
|
||||
text="test",
|
||||
chat=Chat(id=42, type="private"),
|
||||
from_user=User(id=42, is_bot=False, first_name="Test"),
|
||||
)
|
||||
)
|
||||
|
||||
assert handler.command is None
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue