mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Add tests for GetUserProfileAudios, RemoveMyProfilePhoto, and SetMyProfilePhoto methods
This commit is contained in:
parent
ba71be0059
commit
ecaeb5fc7f
3 changed files with 46 additions and 0 deletions
21
tests/test_api/test_methods/test_get_user_profile_audios.py
Normal file
21
tests/test_api/test_methods/test_get_user_profile_audios.py
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
from aiogram.methods import GetUserProfileAudios
|
||||||
|
from aiogram.types import Audio, UserProfileAudios
|
||||||
|
from tests.mocked_bot import MockedBot
|
||||||
|
|
||||||
|
|
||||||
|
class TestGetUserProfileAudios:
|
||||||
|
async def test_bot_method(self, bot: MockedBot):
|
||||||
|
prepare_result = bot.add_result_for(
|
||||||
|
GetUserProfileAudios,
|
||||||
|
ok=True,
|
||||||
|
result=UserProfileAudios(
|
||||||
|
total_count=1,
|
||||||
|
audios=[
|
||||||
|
Audio(file_id="file_id", file_unique_id="file_unique_id", duration=120)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
)
|
||||||
|
|
||||||
|
response: UserProfileAudios = await bot.get_user_profile_audios(user_id=42)
|
||||||
|
bot.get_request()
|
||||||
|
assert response == prepare_result.result
|
||||||
11
tests/test_api/test_methods/test_remove_my_profile_photo.py
Normal file
11
tests/test_api/test_methods/test_remove_my_profile_photo.py
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
from aiogram.methods import RemoveMyProfilePhoto
|
||||||
|
from tests.mocked_bot import MockedBot
|
||||||
|
|
||||||
|
|
||||||
|
class TestRemoveMyProfilePhoto:
|
||||||
|
async def test_bot_method(self, bot: MockedBot):
|
||||||
|
prepare_result = bot.add_result_for(RemoveMyProfilePhoto, ok=True, result=True)
|
||||||
|
|
||||||
|
response: bool = await bot.remove_my_profile_photo()
|
||||||
|
bot.get_request()
|
||||||
|
assert response == prepare_result.result
|
||||||
14
tests/test_api/test_methods/test_set_my_profile_photo.py
Normal file
14
tests/test_api/test_methods/test_set_my_profile_photo.py
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
from aiogram.methods import SetMyProfilePhoto
|
||||||
|
from aiogram.types import InputProfilePhotoStatic
|
||||||
|
from tests.mocked_bot import MockedBot
|
||||||
|
|
||||||
|
|
||||||
|
class TestSetMyProfilePhoto:
|
||||||
|
async def test_bot_method(self, bot: MockedBot):
|
||||||
|
prepare_result = bot.add_result_for(SetMyProfilePhoto, ok=True, result=True)
|
||||||
|
|
||||||
|
response: bool = await bot.set_my_profile_photo(
|
||||||
|
photo=InputProfilePhotoStatic(photo="file_id")
|
||||||
|
)
|
||||||
|
bot.get_request()
|
||||||
|
assert response == prepare_result.result
|
||||||
Loading…
Add table
Add a link
Reference in a new issue