From c0e4d480dd191794b8e93f860260181c1056b1d0 Mon Sep 17 00:00:00 2001 From: Oleg Abramov Date: Wed, 4 Apr 2018 17:09:20 +0300 Subject: [PATCH] Add sendChatAction test --- tests/test_bot.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/test_bot.py b/tests/test_bot.py index 8799cafe..e221a69d 100644 --- a/tests/test_bot.py +++ b/tests/test_bot.py @@ -247,3 +247,15 @@ async def test_send_contact(bot: Bot, event_loop): result = await bot.send_contact(msg.chat.id, phone_number=contact.phone_number, first_name=contact.first_name, last_name=contact.last_name, disable_notification=False) assert result == msg + + +@pytest.mark.asyncio +async def test_send_chat_action(bot: Bot, event_loop): + """ sendChatAction method test """ + from .types.dataset import CHAT + chat = types.Chat(**CHAT) + + async with FakeTelegram(message_dict=True, loop=event_loop): + result = await bot.send_chat_action(chat_id=chat.id, action=types.ChatActions.TYPING) + assert isinstance(result, bool) + assert result is True