From 38a2309c32579e11d131995ad337fb24f296f2f8 Mon Sep 17 00:00:00 2001 From: Oleg A Date: Sun, 5 Apr 2020 16:48:34 +0300 Subject: [PATCH] #289 added setMyCommands test --- tests/test_bot.py | 11 +++++++++++ tests/types/dataset.py | 5 +++++ 2 files changed, 16 insertions(+) diff --git a/tests/test_bot.py b/tests/test_bot.py index 0fa23df4..b2289c8f 100644 --- a/tests/test_bot.py +++ b/tests/test_bot.py @@ -473,6 +473,17 @@ async def test_answer_callback_query(bot: Bot, event_loop): assert result is True +async def test_set_my_commands(bot: Bot, event_loop): + """ setMyCommands method test """ + from .types.dataset import BOT_COMMAND + + async with FakeTelegram(message_dict=True, loop=event_loop): + commands = [types.BotCommand(**BOT_COMMAND), types.BotCommand(**BOT_COMMAND)] + result = await bot.set_my_commands(commands) + assert isinstance(result, bool) + assert result is True + + async def test_edit_message_text_by_bot(bot: Bot, event_loop): """ editMessageText method test """ from .types.dataset import EDITED_MESSAGE diff --git a/tests/types/dataset.py b/tests/types/dataset.py index 8950344c..310024cb 100644 --- a/tests/types/dataset.py +++ b/tests/types/dataset.py @@ -35,6 +35,11 @@ AUDIO = { "file_size": 9507774, } +BOT_COMMAND = { + "command": "start", + "description": "Start bot", +} + CHAT_MEMBER = { "user": USER, "status": "administrator",