mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-08 17:13:56 +00:00
Added test sendVideoNote
This commit is contained in:
parent
7af8d2da94
commit
5a7d01ae71
2 changed files with 29 additions and 1 deletions
|
|
@ -141,3 +141,17 @@ async def test_send_voice(bot: Bot, event_loop):
|
|||
parse_mode=types.ParseMode.HTML, duration=voice.duration,
|
||||
disable_notification=False)
|
||||
assert result == msg
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_send_video_note(bot: Bot, event_loop):
|
||||
""" sendVideoNote method test """
|
||||
from .types.dataset import MESSAGE_WITH_VIDEO_NOTE, VIDEO_NOTE
|
||||
msg = types.Message(**MESSAGE_WITH_VIDEO_NOTE)
|
||||
video_note = types.VideoNote(**VIDEO_NOTE)
|
||||
|
||||
async with FakeTelegram(message_dict=MESSAGE_WITH_VIDEO_NOTE, loop=event_loop):
|
||||
result = await bot.send_video_note(chat_id=msg.chat.id, video_note=video_note.file_id,
|
||||
duration=video_note.duration, length=video_note.length,
|
||||
disable_notification=False)
|
||||
assert result == msg
|
||||
|
|
|
|||
|
|
@ -152,6 +152,14 @@ VIDEO = {
|
|||
"file_size": 10099782
|
||||
}
|
||||
|
||||
VIDEO_NOTE = {
|
||||
"duration": 4,
|
||||
"length": 240,
|
||||
"thumb": PHOTO,
|
||||
"file_id": "AbCdEfGhIjKlMnOpQrStUvWxYz",
|
||||
"file_size": 186562
|
||||
}
|
||||
|
||||
VOICE = {
|
||||
"duration": 1,
|
||||
"mime_type": "audio/ogg",
|
||||
|
|
@ -309,7 +317,13 @@ MESSAGE_WITH_VIDEO = {
|
|||
"caption": "description"
|
||||
}
|
||||
|
||||
MESSAGE_WITH_VIDEO_NOTE = {}
|
||||
MESSAGE_WITH_VIDEO_NOTE = {
|
||||
"message_id": 55934,
|
||||
"from": USER,
|
||||
"chat": CHAT,
|
||||
"date": 1522835890,
|
||||
"video_note": VIDEO_NOTE
|
||||
}
|
||||
|
||||
MESSAGE_WITH_VOICE = {
|
||||
"message_id": 12345,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue