Added tests

This commit is contained in:
Alex Root Junior 2023-04-22 18:00:08 +03:00
parent bd9d05a703
commit 73c58e6a7e
No known key found for this signature in database
GPG key ID: 074C1D455EBEA4AC
2 changed files with 21 additions and 0 deletions

View file

@ -0,0 +1,11 @@
from aiogram.methods import GetMyName
from aiogram.types import BotDescription, BotName
from tests.mocked_bot import MockedBot
class TestGetMyName:
async def test_bot_method(self, bot: MockedBot):
prepare_result = bot.add_result_for(GetMyName, ok=True, result=BotName(name="Test"))
response: BotName = await bot.get_my_name()
assert response == prepare_result.result

View file

@ -0,0 +1,10 @@
from aiogram.methods import SetMyName
from tests.mocked_bot import MockedBot
class TestSetMyName:
async def test_bot_method(self, bot: MockedBot):
prepare_result = bot.add_result_for(SetMyName, ok=True, result=True)
response: bool = await bot.set_my_name()
assert response == prepare_result.result