Add getFile test

This commit is contained in:
Oleg Abramov 2018-04-04 18:08:18 +03:00
parent b95e977c12
commit 959f41a2f0
2 changed files with 17 additions and 0 deletions

View file

@ -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)

View file

@ -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