From d1cea909794cc958898840e0694d6bea91212883 Mon Sep 17 00:00:00 2001 From: Oleg Abramov Date: Wed, 4 Apr 2018 16:31:48 +0300 Subject: [PATCH] Add sendLocation test --- tests/test_bot.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/test_bot.py b/tests/test_bot.py index 11a638a9..d0776251 100644 --- a/tests/test_bot.py +++ b/tests/test_bot.py @@ -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