mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Add sendLocation test
This commit is contained in:
parent
21439b8532
commit
d1cea90979
1 changed files with 13 additions and 0 deletions
|
|
@ -169,3 +169,16 @@ async def test_send_media_group(bot: Bot, event_loop):
|
|||
result = await bot.send_media_group(msg.chat.id, media=media, disable_notification=False)
|
||||
assert len(result) == len(media)
|
||||
assert result.pop().media_group_id
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_send_location(bot: Bot, event_loop):
|
||||
""" sendLocation method test with file_id """
|
||||
from .types.dataset import MESSAGE_WITH_LOCATION, LOCATION
|
||||
msg = types.Message(**MESSAGE_WITH_LOCATION)
|
||||
location = types.Location(**LOCATION)
|
||||
|
||||
async with FakeTelegram(message_dict=MESSAGE_WITH_LOCATION, loop=event_loop):
|
||||
result = await bot.send_location(msg.chat.id, latitude=location.latitude, longitude=location.longitude,
|
||||
live_period=10, disable_notification=False)
|
||||
assert result == msg
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue