mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
CR fix: add forgotten format
This commit is contained in:
parent
2dffa0e3dd
commit
9b83aa36db
2 changed files with 5 additions and 5 deletions
|
|
@ -71,13 +71,12 @@ class Command(Filter):
|
|||
elif isinstance(commands, Iterable):
|
||||
if not all(map(lambda cmd: isinstance(cmd, str), commands)):
|
||||
raise ValueError(
|
||||
"Command filter doesn't support {} as input. "
|
||||
"It only supports str, BotCommand object or their Iterable"
|
||||
"Command filter only supports str, BotCommand object or their Iterable"
|
||||
)
|
||||
else:
|
||||
raise ValueError(
|
||||
"Command filter doesn't support {} as input. "
|
||||
"It only supports str, BotCommand object or their Iterable"
|
||||
"It only supports str, BotCommand object or their Iterable".format(type(commands))
|
||||
)
|
||||
commands = [cmd.command if isinstance(cmd, BotCommand) else cmd for cmd in commands]
|
||||
|
||||
|
|
|
|||
|
|
@ -141,8 +141,9 @@ async def test_commands_filter_not_checked():
|
|||
assert not await start_filter.check(message_with_command)
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_commands_filter_not_checked():
|
||||
def test_commands_filter_not_checked():
|
||||
with pytest.raises(ValueError):
|
||||
start_filter = Command(commands=42) # noqa
|
||||
with pytest.raises(ValueError):
|
||||
start_filter = Command(commands=[42]) # noqa
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue