From 959f41a2f099648d72529156ee682ba80ce239cc Mon Sep 17 00:00:00 2001 From: Oleg Abramov Date: Wed, 4 Apr 2018 18:08:18 +0300 Subject: [PATCH] Add getFile test --- tests/test_bot.py | 11 +++++++++++ tests/types/dataset.py | 6 ++++++ 2 files changed, 17 insertions(+) diff --git a/tests/test_bot.py b/tests/test_bot.py index 8480edf0..780b2b02 100644 --- a/tests/test_bot.py +++ b/tests/test_bot.py @@ -270,3 +270,14 @@ async def test_get_user_profile_photo(bot: Bot, event_loop): async with FakeTelegram(message_dict=USER_PROFILE_PHOTOS, loop=event_loop): result = await bot.get_user_profile_photos(user_id=user.id, offset=1, limit=1) assert isinstance(result, types.UserProfilePhotos) + + +@pytest.mark.asyncio +async def test_get_file(bot: Bot, event_loop): + """ getFile method test """ + from .types.dataset import FILE + file = types.File(**FILE) + + async with FakeTelegram(message_dict=FILE, loop=event_loop): + result = await bot.get_file(file_id=file.file_id) + assert isinstance(result, types.File) diff --git a/tests/types/dataset.py b/tests/types/dataset.py index bca005c4..bc7d9920 100644 --- a/tests/types/dataset.py +++ b/tests/types/dataset.py @@ -398,6 +398,12 @@ USER_PROFILE_PHOTOS = { ] } +FILE = { + "file_id": "XXXYYYZZZ", + "file_size": 5254, + "file_path": "voice\/file_8" +} + UPDATE = { "update_id": 123456789, "message": MESSAGE