mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-06 16:15:51 +00:00
Add getFile test
This commit is contained in:
parent
b95e977c12
commit
959f41a2f0
2 changed files with 17 additions and 0 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue