From c49d9c35fe291b96e72d829f03c613aa965c15fa Mon Sep 17 00:00:00 2001 From: Oleg Abramov Date: Wed, 4 Apr 2018 12:48:28 +0300 Subject: [PATCH] Added test sendVideo --- tests/test_bot.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/test_bot.py b/tests/test_bot.py index 8937f4fb..7ab61d5f 100644 --- a/tests/test_bot.py +++ b/tests/test_bot.py @@ -112,3 +112,18 @@ async def test_send_document(bot: Bot, event_loop): result = await bot.send_document(chat_id=msg.chat.id, document=msg.document.file_id, caption=msg.caption, parse_mode=types.ParseMode.HTML, disable_notification=False) assert result == msg + + +@pytest.mark.asyncio +async def test_send_video(bot: Bot, event_loop): + """ sendVideo method test """ + from .types.dataset import MESSAGE_WITH_VIDEO, VIDEO + msg = types.Message(**MESSAGE_WITH_VIDEO) + video = types.Video(**VIDEO) + + async with FakeTelegram(message_dict=MESSAGE_WITH_VIDEO, loop=event_loop): + result = await bot.send_video(chat_id=msg.chat.id, video=video.file_id, duration=video.duration, + width=video.width, height=video.height, caption=msg.caption, + parse_mode=types.ParseMode.HTML, supports_streaming=True, + disable_notification=False) + assert result == msg