mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Added test sendVoice
This commit is contained in:
parent
c49d9c35fe
commit
7af8d2da94
1 changed files with 14 additions and 0 deletions
|
|
@ -127,3 +127,17 @@ async def test_send_video(bot: Bot, event_loop):
|
|||
parse_mode=types.ParseMode.HTML, supports_streaming=True,
|
||||
disable_notification=False)
|
||||
assert result == msg
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_send_voice(bot: Bot, event_loop):
|
||||
""" sendVoice method test """
|
||||
from .types.dataset import MESSAGE_WITH_VOICE, VOICE
|
||||
msg = types.Message(**MESSAGE_WITH_VOICE)
|
||||
voice = types.Voice(**VOICE)
|
||||
|
||||
async with FakeTelegram(message_dict=MESSAGE_WITH_VOICE, loop=event_loop):
|
||||
result = await bot.send_voice(chat_id=msg.chat.id, voice=voice.file_id, caption=msg.caption,
|
||||
parse_mode=types.ParseMode.HTML, duration=voice.duration,
|
||||
disable_notification=False)
|
||||
assert result == msg
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue