diff --git a/tests/mocked_bot.py b/tests/mocked_bot.py index 9a1a1609..77da88bc 100644 --- a/tests/mocked_bot.py +++ b/tests/mocked_bot.py @@ -41,7 +41,7 @@ class MockedBot(Bot): self, method: Type[TelegramMethod[T]], ok: bool, - result: Optional[T] = None, + result: T = None, description: Optional[str] = None, error_code: Optional[int] = None, migrate_to_chat_id: Optional[int] = None, diff --git a/tests/test_api/test_methods/test_delete_message.py b/tests/test_api/test_methods/test_delete_message.py index 286f2d6b..0b510abd 100644 --- a/tests/test_api/test_methods/test_delete_message.py +++ b/tests/test_api/test_methods/test_delete_message.py @@ -1,4 +1,5 @@ import pytest + from aiogram.api.methods import DeleteMessage, Request from tests.mocked_bot import MockedBot diff --git a/tests/test_api/test_methods/test_delete_sticker_from_set.py b/tests/test_api/test_methods/test_delete_sticker_from_set.py index a0e02c69..8b344225 100644 --- a/tests/test_api/test_methods/test_delete_sticker_from_set.py +++ b/tests/test_api/test_methods/test_delete_sticker_from_set.py @@ -1,4 +1,5 @@ import pytest + from aiogram.api.methods import DeleteStickerFromSet, Request from tests.mocked_bot import MockedBot diff --git a/tests/test_api/test_methods/test_delete_webhook.py b/tests/test_api/test_methods/test_delete_webhook.py index 16b8e1c6..22c4d5c9 100644 --- a/tests/test_api/test_methods/test_delete_webhook.py +++ b/tests/test_api/test_methods/test_delete_webhook.py @@ -1,4 +1,5 @@ import pytest + from aiogram.api.methods import DeleteWebhook, Request from tests.mocked_bot import MockedBot diff --git a/tests/test_api/test_methods/test_edit_message_caption.py b/tests/test_api/test_methods/test_edit_message_caption.py index 0a1796cb..50fcf838 100644 --- a/tests/test_api/test_methods/test_edit_message_caption.py +++ b/tests/test_api/test_methods/test_edit_message_caption.py @@ -2,6 +2,7 @@ import datetime from typing import Union import pytest + from aiogram.api.methods import EditMessageCaption, Request from aiogram.api.types import Chat, Message from tests.mocked_bot import MockedBot diff --git a/tests/test_api/test_methods/test_edit_message_live_location.py b/tests/test_api/test_methods/test_edit_message_live_location.py index 1e8dcfe9..96e566ac 100644 --- a/tests/test_api/test_methods/test_edit_message_live_location.py +++ b/tests/test_api/test_methods/test_edit_message_live_location.py @@ -1,6 +1,7 @@ from typing import Union import pytest + from aiogram.api.methods import EditMessageLiveLocation, Request from aiogram.api.types import Message from tests.mocked_bot import MockedBot @@ -12,7 +13,7 @@ class TestEditMessageLiveLocation: prepare_result = bot.add_result_for(EditMessageLiveLocation, ok=True, result=True) response: Union[Message, bool] = await EditMessageLiveLocation( - latitude=3.141592, longitude=3.141592, + latitude=3.141592, longitude=3.141592 ) request: Request = bot.get_request() assert request.method == "editMessageLiveLocation" @@ -23,7 +24,7 @@ class TestEditMessageLiveLocation: prepare_result = bot.add_result_for(EditMessageLiveLocation, ok=True, result=True) response: Union[Message, bool] = await bot.edit_message_live_location( - latitude=3.141592, longitude=3.141592, + latitude=3.141592, longitude=3.141592 ) request: Request = bot.get_request() assert request.method == "editMessageLiveLocation" diff --git a/tests/test_api/test_methods/test_edit_message_media.py b/tests/test_api/test_methods/test_edit_message_media.py index e3a4bb0a..11f94be4 100644 --- a/tests/test_api/test_methods/test_edit_message_media.py +++ b/tests/test_api/test_methods/test_edit_message_media.py @@ -1,6 +1,7 @@ from typing import Union import pytest + from aiogram.api.methods import EditMessageMedia, Request from aiogram.api.types import InputMedia, Message from tests.mocked_bot import MockedBot diff --git a/tests/test_api/test_methods/test_edit_message_reply_markup.py b/tests/test_api/test_methods/test_edit_message_reply_markup.py index 46629595..48f69e2a 100644 --- a/tests/test_api/test_methods/test_edit_message_reply_markup.py +++ b/tests/test_api/test_methods/test_edit_message_reply_markup.py @@ -1,6 +1,7 @@ from typing import Union import pytest + from aiogram.api.methods import EditMessageReplyMarkup, Request from aiogram.api.types import InlineKeyboardButton, InlineKeyboardMarkup, Message from tests.mocked_bot import MockedBot diff --git a/tests/test_api/test_methods/test_edit_message_text.py b/tests/test_api/test_methods/test_edit_message_text.py index 724f7ce4..0e349a03 100644 --- a/tests/test_api/test_methods/test_edit_message_text.py +++ b/tests/test_api/test_methods/test_edit_message_text.py @@ -1,6 +1,7 @@ from typing import Union import pytest + from aiogram.api.methods import EditMessageText, Request from aiogram.api.types import Message from tests.mocked_bot import MockedBot diff --git a/tests/test_api/test_methods/test_export_chat_invite_link.py b/tests/test_api/test_methods/test_export_chat_invite_link.py index c28e7451..8e76e907 100644 --- a/tests/test_api/test_methods/test_export_chat_invite_link.py +++ b/tests/test_api/test_methods/test_export_chat_invite_link.py @@ -1,4 +1,5 @@ import pytest + from aiogram.api.methods import ExportChatInviteLink, Request from tests.mocked_bot import MockedBot diff --git a/tests/test_api/test_methods/test_forward_message.py b/tests/test_api/test_methods/test_forward_message.py index 6ea4e0ab..3e2ae0d9 100644 --- a/tests/test_api/test_methods/test_forward_message.py +++ b/tests/test_api/test_methods/test_forward_message.py @@ -1,6 +1,7 @@ import datetime import pytest + from aiogram.api.methods import ForwardMessage, Request from aiogram.api.types import Chat, Message from tests.mocked_bot import MockedBot diff --git a/tests/test_api/test_methods/test_get_chat.py b/tests/test_api/test_methods/test_get_chat.py index 0bb78101..d88b5261 100644 --- a/tests/test_api/test_methods/test_get_chat.py +++ b/tests/test_api/test_methods/test_get_chat.py @@ -1,4 +1,5 @@ import pytest + from aiogram.api.methods import GetChat, Request from aiogram.api.types import Chat from tests.mocked_bot import MockedBot diff --git a/tests/test_api/test_methods/test_get_chat_administrators.py b/tests/test_api/test_methods/test_get_chat_administrators.py index acfd6929..f5e76c2e 100644 --- a/tests/test_api/test_methods/test_get_chat_administrators.py +++ b/tests/test_api/test_methods/test_get_chat_administrators.py @@ -1,6 +1,7 @@ from typing import List import pytest + from aiogram.api.methods import GetChatAdministrators, Request from aiogram.api.types import ChatMember, User from tests.mocked_bot import MockedBot diff --git a/tests/test_api/test_methods/test_get_chat_member.py b/tests/test_api/test_methods/test_get_chat_member.py index 2a3e22a1..d63bdbd0 100644 --- a/tests/test_api/test_methods/test_get_chat_member.py +++ b/tests/test_api/test_methods/test_get_chat_member.py @@ -1,4 +1,5 @@ import pytest + from aiogram.api.methods import GetChatMember, Request from aiogram.api.types import ChatMember, User from tests.mocked_bot import MockedBot diff --git a/tests/test_api/test_methods/test_get_chat_members_count.py b/tests/test_api/test_methods/test_get_chat_members_count.py index 4436fc96..1ae1a6e7 100644 --- a/tests/test_api/test_methods/test_get_chat_members_count.py +++ b/tests/test_api/test_methods/test_get_chat_members_count.py @@ -1,4 +1,5 @@ import pytest + from aiogram.api.methods import GetChatMembersCount, Request from tests.mocked_bot import MockedBot @@ -8,7 +9,7 @@ class TestGetChatMembersCount: async def test_method(self, bot: MockedBot): prepare_result = bot.add_result_for(GetChatMembersCount, ok=True, result=42) - response: int = await GetChatMembersCount(chat_id=-42,) + response: int = await GetChatMembersCount(chat_id=-42) request: Request = bot.get_request() assert request.method == "getChatMembersCount" assert response == prepare_result.result @@ -17,7 +18,7 @@ class TestGetChatMembersCount: async def test_bot_method(self, bot: MockedBot): prepare_result = bot.add_result_for(GetChatMembersCount, ok=True, result=42) - response: int = await bot.get_chat_members_count(chat_id=-42,) + response: int = await bot.get_chat_members_count(chat_id=-42) request: Request = bot.get_request() assert request.method == "getChatMembersCount" assert response == prepare_result.result diff --git a/tests/test_api/test_methods/test_get_file.py b/tests/test_api/test_methods/test_get_file.py index 7c2f53af..6b8e2ff0 100644 --- a/tests/test_api/test_methods/test_get_file.py +++ b/tests/test_api/test_methods/test_get_file.py @@ -1,4 +1,5 @@ import pytest + from aiogram.api.methods import GetFile, Request from aiogram.api.types import File from tests.mocked_bot import MockedBot diff --git a/tests/test_api/test_methods/test_get_game_high_scores.py b/tests/test_api/test_methods/test_get_game_high_scores.py index 08eb25e9..efeac5cb 100644 --- a/tests/test_api/test_methods/test_get_game_high_scores.py +++ b/tests/test_api/test_methods/test_get_game_high_scores.py @@ -1,6 +1,7 @@ from typing import List import pytest + from aiogram.api.methods import GetGameHighScores, Request from aiogram.api.types import GameHighScore, User from tests.mocked_bot import MockedBot diff --git a/tests/test_api/test_methods/test_get_sticker_set.py b/tests/test_api/test_methods/test_get_sticker_set.py index 01b0cc83..236116ce 100644 --- a/tests/test_api/test_methods/test_get_sticker_set.py +++ b/tests/test_api/test_methods/test_get_sticker_set.py @@ -1,4 +1,5 @@ import pytest + from aiogram.api.methods import GetStickerSet, Request from aiogram.api.types import Sticker, StickerSet from tests.mocked_bot import MockedBot diff --git a/tests/test_api/test_methods/test_get_updates.py b/tests/test_api/test_methods/test_get_updates.py index cec48071..92081e7b 100644 --- a/tests/test_api/test_methods/test_get_updates.py +++ b/tests/test_api/test_methods/test_get_updates.py @@ -1,6 +1,7 @@ from typing import List import pytest + from aiogram.api.methods import GetUpdates, Request from aiogram.api.types import Update from tests.mocked_bot import MockedBot diff --git a/tests/test_api/test_methods/test_get_user_profile_photos.py b/tests/test_api/test_methods/test_get_user_profile_photos.py index ce02c162..9d277f98 100644 --- a/tests/test_api/test_methods/test_get_user_profile_photos.py +++ b/tests/test_api/test_methods/test_get_user_profile_photos.py @@ -1,4 +1,5 @@ import pytest + from aiogram.api.methods import GetUserProfilePhotos, Request from aiogram.api.types import PhotoSize, UserProfilePhotos from tests.mocked_bot import MockedBot diff --git a/tests/test_api/test_methods/test_get_webhook_info.py b/tests/test_api/test_methods/test_get_webhook_info.py index 0ef09081..e3259125 100644 --- a/tests/test_api/test_methods/test_get_webhook_info.py +++ b/tests/test_api/test_methods/test_get_webhook_info.py @@ -1,4 +1,5 @@ import pytest + from aiogram.api.methods import GetWebhookInfo, Request from aiogram.api.types import WebhookInfo from tests.mocked_bot import MockedBot diff --git a/tests/test_api/test_methods/test_kick_chat_member.py b/tests/test_api/test_methods/test_kick_chat_member.py index ade81c6d..f142f649 100644 --- a/tests/test_api/test_methods/test_kick_chat_member.py +++ b/tests/test_api/test_methods/test_kick_chat_member.py @@ -1,4 +1,5 @@ import pytest + from aiogram.api.methods import KickChatMember, Request from tests.mocked_bot import MockedBot @@ -8,9 +9,7 @@ class TestKickChatMember: async def test_method(self, bot: MockedBot): prepare_result = bot.add_result_for(KickChatMember, ok=True, result=True) - response: bool = await KickChatMember( - chat_id=-42, user_id=42, - ) + response: bool = await KickChatMember(chat_id=-42, user_id=42) request: Request = bot.get_request() assert request.method == "kickChatMember" assert response == prepare_result.result @@ -19,9 +18,7 @@ class TestKickChatMember: async def test_bot_method(self, bot: MockedBot): prepare_result = bot.add_result_for(KickChatMember, ok=True, result=True) - response: bool = await bot.kick_chat_member( - chat_id=-42, user_id=42, - ) + response: bool = await bot.kick_chat_member(chat_id=-42, user_id=42) request: Request = bot.get_request() assert request.method == "kickChatMember" assert response == prepare_result.result diff --git a/tests/test_api/test_methods/test_leave_chat.py b/tests/test_api/test_methods/test_leave_chat.py index 834e9578..f9f876e6 100644 --- a/tests/test_api/test_methods/test_leave_chat.py +++ b/tests/test_api/test_methods/test_leave_chat.py @@ -1,4 +1,5 @@ import pytest + from aiogram.api.methods import LeaveChat, Request from tests.mocked_bot import MockedBot @@ -8,7 +9,7 @@ class TestLeaveChat: async def test_method(self, bot: MockedBot): prepare_result = bot.add_result_for(LeaveChat, ok=True, result=True) - response: bool = await LeaveChat(chat_id=-42,) + response: bool = await LeaveChat(chat_id=-42) request: Request = bot.get_request() assert request.method == "leaveChat" assert response == prepare_result.result @@ -17,7 +18,7 @@ class TestLeaveChat: async def test_bot_method(self, bot: MockedBot): prepare_result = bot.add_result_for(LeaveChat, ok=True, result=True) - response: bool = await bot.leave_chat(chat_id=-42,) + response: bool = await bot.leave_chat(chat_id=-42) request: Request = bot.get_request() assert request.method == "leaveChat" assert response == prepare_result.result diff --git a/tests/test_api/test_methods/test_pin_chat_message.py b/tests/test_api/test_methods/test_pin_chat_message.py index 3a4c47aa..fa87d796 100644 --- a/tests/test_api/test_methods/test_pin_chat_message.py +++ b/tests/test_api/test_methods/test_pin_chat_message.py @@ -1,4 +1,5 @@ import pytest + from aiogram.api.methods import PinChatMessage, Request from tests.mocked_bot import MockedBot @@ -8,9 +9,7 @@ class TestPinChatMessage: async def test_method(self, bot: MockedBot): prepare_result = bot.add_result_for(PinChatMessage, ok=True, result=True) - response: bool = await PinChatMessage( - chat_id=-42, message_id=42, - ) + response: bool = await PinChatMessage(chat_id=-42, message_id=42) request: Request = bot.get_request() assert request.method == "pinChatMessage" assert response == prepare_result.result @@ -19,9 +18,7 @@ class TestPinChatMessage: async def test_bot_method(self, bot: MockedBot): prepare_result = bot.add_result_for(PinChatMessage, ok=True, result=True) - response: bool = await bot.pin_chat_message( - chat_id=-42, message_id=42, - ) + response: bool = await bot.pin_chat_message(chat_id=-42, message_id=42) request: Request = bot.get_request() assert request.method == "pinChatMessage" assert response == prepare_result.result diff --git a/tests/test_api/test_methods/test_promote_chat_member.py b/tests/test_api/test_methods/test_promote_chat_member.py index 93695602..3b8a7797 100644 --- a/tests/test_api/test_methods/test_promote_chat_member.py +++ b/tests/test_api/test_methods/test_promote_chat_member.py @@ -1,4 +1,5 @@ import pytest + from aiogram.api.methods import PromoteChatMember, Request from tests.mocked_bot import MockedBot diff --git a/tests/test_api/test_methods/test_restrict_chat_member.py b/tests/test_api/test_methods/test_restrict_chat_member.py index da0b4354..a48caeff 100644 --- a/tests/test_api/test_methods/test_restrict_chat_member.py +++ b/tests/test_api/test_methods/test_restrict_chat_member.py @@ -1,4 +1,5 @@ import pytest + from aiogram.api.methods import Request, RestrictChatMember from aiogram.api.types import ChatPermissions from tests.mocked_bot import MockedBot @@ -10,7 +11,7 @@ class TestRestrictChatMember: prepare_result = bot.add_result_for(RestrictChatMember, ok=True, result=True) response: bool = await RestrictChatMember( - chat_id=-42, user_id=42, permissions=ChatPermissions(), + chat_id=-42, user_id=42, permissions=ChatPermissions() ) request: Request = bot.get_request() assert request.method == "restrictChatMember" @@ -21,7 +22,7 @@ class TestRestrictChatMember: prepare_result = bot.add_result_for(RestrictChatMember, ok=True, result=True) response: bool = await bot.restrict_chat_member( - chat_id=-42, user_id=42, permissions=ChatPermissions(), + chat_id=-42, user_id=42, permissions=ChatPermissions() ) request: Request = bot.get_request() assert request.method == "restrictChatMember" diff --git a/tests/test_api/test_methods/test_send_animation.py b/tests/test_api/test_methods/test_send_animation.py index d23a6d36..06af5218 100644 --- a/tests/test_api/test_methods/test_send_animation.py +++ b/tests/test_api/test_methods/test_send_animation.py @@ -1,6 +1,7 @@ import datetime import pytest + from aiogram.api.methods import Request, SendAnimation from aiogram.api.types import Animation, Chat, Message from tests.mocked_bot import MockedBot diff --git a/tests/test_api/test_methods/test_send_audio.py b/tests/test_api/test_methods/test_send_audio.py index fd28f61b..c15d6728 100644 --- a/tests/test_api/test_methods/test_send_audio.py +++ b/tests/test_api/test_methods/test_send_audio.py @@ -1,6 +1,7 @@ import datetime import pytest + from aiogram.api.methods import Request, SendAudio from aiogram.api.types import Audio, Chat, File, Message from tests.mocked_bot import MockedBot diff --git a/tests/test_api/test_methods/test_send_chat_action.py b/tests/test_api/test_methods/test_send_chat_action.py index e265b264..1d98b482 100644 --- a/tests/test_api/test_methods/test_send_chat_action.py +++ b/tests/test_api/test_methods/test_send_chat_action.py @@ -1,4 +1,5 @@ import pytest + from aiogram.api.methods import Request, SendChatAction from tests.mocked_bot import MockedBot diff --git a/tests/test_api/test_methods/test_send_contact.py b/tests/test_api/test_methods/test_send_contact.py index 7b13af6b..44435d2d 100644 --- a/tests/test_api/test_methods/test_send_contact.py +++ b/tests/test_api/test_methods/test_send_contact.py @@ -1,6 +1,7 @@ import datetime import pytest + from aiogram.api.methods import Request, SendContact from aiogram.api.types import Chat, Contact, Message from tests.mocked_bot import MockedBot @@ -27,14 +28,20 @@ class TestSendContact: @pytest.mark.asyncio async def test_bot_method(self, bot: MockedBot): - prepare_result = bot.add_result_for(SendContact, ok=True, result=Message( + prepare_result = bot.add_result_for( + SendContact, + ok=True, + result=Message( message_id=42, date=datetime.datetime.now(), contact=Contact(phone_number="911", first_name="911"), chat=Chat(id=42, type="private"), - ),) + ), + ) - response: Message = await bot.send_contact(chat_id=42, phone_number="911", first_name="911") + response: Message = await bot.send_contact( + chat_id=42, phone_number="911", first_name="911" + ) request: Request = bot.get_request() assert request.method == "sendContact" assert response == prepare_result.result diff --git a/tests/test_api/test_methods/test_send_document.py b/tests/test_api/test_methods/test_send_document.py index 69fbd458..c91ebfa2 100644 --- a/tests/test_api/test_methods/test_send_document.py +++ b/tests/test_api/test_methods/test_send_document.py @@ -1,4 +1,5 @@ import pytest + from aiogram.api.methods import Request, SendDocument from tests.mocked_bot import MockedBot @@ -9,9 +10,7 @@ class TestSendDocument: async def test_method(self, bot: MockedBot): prepare_result = bot.add_result_for(SendDocument, ok=True, result=None) - response: Message = await SendDocument( - chat_id=..., document=..., - ) + response: Message = await SendDocument(chat_id=..., document=...) request: Request = bot.get_request() assert request.method == "sendDocument" # assert request.data == {} @@ -21,9 +20,7 @@ class TestSendDocument: async def test_bot_method(self, bot: MockedBot): prepare_result = bot.add_result_for(SendDocument, ok=True, result=None) - response: Message = await bot.send_document( - chat_id=..., document=..., - ) + response: Message = await bot.send_document(chat_id=..., document=...) request: Request = bot.get_request() assert request.method == "sendDocument" # assert request.data == {} diff --git a/tests/test_api/test_methods/test_send_game.py b/tests/test_api/test_methods/test_send_game.py index 7726becc..b2a6b114 100644 --- a/tests/test_api/test_methods/test_send_game.py +++ b/tests/test_api/test_methods/test_send_game.py @@ -1,4 +1,5 @@ import pytest + from aiogram.api.methods import Request, SendGame from tests.mocked_bot import MockedBot @@ -9,9 +10,7 @@ class TestSendGame: async def test_method(self, bot: MockedBot): prepare_result = bot.add_result_for(SendGame, ok=True, result=None) - response: Message = await SendGame( - chat_id=..., game_short_name=..., - ) + response: Message = await SendGame(chat_id=..., game_short_name=...) request: Request = bot.get_request() assert request.method == "sendGame" # assert request.data == {} @@ -21,9 +20,7 @@ class TestSendGame: async def test_bot_method(self, bot: MockedBot): prepare_result = bot.add_result_for(SendGame, ok=True, result=None) - response: Message = await bot.send_game( - chat_id=..., game_short_name=..., - ) + response: Message = await bot.send_game(chat_id=..., game_short_name=...) request: Request = bot.get_request() assert request.method == "sendGame" # assert request.data == {} diff --git a/tests/test_api/test_methods/test_send_invoice.py b/tests/test_api/test_methods/test_send_invoice.py index 93f94cdb..b69272bc 100644 --- a/tests/test_api/test_methods/test_send_invoice.py +++ b/tests/test_api/test_methods/test_send_invoice.py @@ -1,4 +1,5 @@ import pytest + from aiogram.api.methods import Request, SendInvoice from tests.mocked_bot import MockedBot diff --git a/tests/test_api/test_methods/test_send_location.py b/tests/test_api/test_methods/test_send_location.py index 7caf659b..33a2fda6 100644 --- a/tests/test_api/test_methods/test_send_location.py +++ b/tests/test_api/test_methods/test_send_location.py @@ -1,4 +1,5 @@ import pytest + from aiogram.api.methods import Request, SendLocation from tests.mocked_bot import MockedBot @@ -9,9 +10,7 @@ class TestSendLocation: async def test_method(self, bot: MockedBot): prepare_result = bot.add_result_for(SendLocation, ok=True, result=None) - response: Message = await SendLocation( - chat_id=..., latitude=..., longitude=..., - ) + response: Message = await SendLocation(chat_id=..., latitude=..., longitude=...) request: Request = bot.get_request() assert request.method == "sendLocation" # assert request.data == {} @@ -21,9 +20,7 @@ class TestSendLocation: async def test_bot_method(self, bot: MockedBot): prepare_result = bot.add_result_for(SendLocation, ok=True, result=None) - response: Message = await bot.send_location( - chat_id=..., latitude=..., longitude=..., - ) + response: Message = await bot.send_location(chat_id=..., latitude=..., longitude=...) request: Request = bot.get_request() assert request.method == "sendLocation" # assert request.data == {} diff --git a/tests/test_api/test_methods/test_send_media_group.py b/tests/test_api/test_methods/test_send_media_group.py index bfec3864..7983260a 100644 --- a/tests/test_api/test_methods/test_send_media_group.py +++ b/tests/test_api/test_methods/test_send_media_group.py @@ -1,4 +1,5 @@ import pytest + from aiogram.api.methods import Request, SendMediaGroup from tests.mocked_bot import MockedBot @@ -9,9 +10,7 @@ class TestSendMediaGroup: async def test_method(self, bot: MockedBot): prepare_result = bot.add_result_for(SendMediaGroup, ok=True, result=None) - response: List[Message] = await SendMediaGroup( - chat_id=..., media=..., - ) + response: List[Message] = await SendMediaGroup(chat_id=..., media=...) request: Request = bot.get_request() assert request.method == "sendMediaGroup" # assert request.data == {} @@ -21,9 +20,7 @@ class TestSendMediaGroup: async def test_bot_method(self, bot: MockedBot): prepare_result = bot.add_result_for(SendMediaGroup, ok=True, result=None) - response: List[Message] = await bot.send_media_group( - chat_id=..., media=..., - ) + response: List[Message] = await bot.send_media_group(chat_id=..., media=...) request: Request = bot.get_request() assert request.method == "sendMediaGroup" # assert request.data == {} diff --git a/tests/test_api/test_methods/test_send_message.py b/tests/test_api/test_methods/test_send_message.py index 68492ff0..6fb8d34a 100644 --- a/tests/test_api/test_methods/test_send_message.py +++ b/tests/test_api/test_methods/test_send_message.py @@ -1,4 +1,5 @@ import pytest + from aiogram.api.methods import Request, SendMessage from tests.mocked_bot import MockedBot @@ -9,9 +10,7 @@ class TestSendMessage: async def test_method(self, bot: MockedBot): prepare_result = bot.add_result_for(SendMessage, ok=True, result=None) - response: Message = await SendMessage( - chat_id=..., text=..., - ) + response: Message = await SendMessage(chat_id=..., text=...) request: Request = bot.get_request() assert request.method == "sendMessage" # assert request.data == {} @@ -21,9 +20,7 @@ class TestSendMessage: async def test_bot_method(self, bot: MockedBot): prepare_result = bot.add_result_for(SendMessage, ok=True, result=None) - response: Message = await bot.send_message( - chat_id=..., text=..., - ) + response: Message = await bot.send_message(chat_id=..., text=...) request: Request = bot.get_request() assert request.method == "sendMessage" # assert request.data == {} diff --git a/tests/test_api/test_methods/test_send_photo.py b/tests/test_api/test_methods/test_send_photo.py index d62af71a..08f02ead 100644 --- a/tests/test_api/test_methods/test_send_photo.py +++ b/tests/test_api/test_methods/test_send_photo.py @@ -1,4 +1,5 @@ import pytest + from aiogram.api.methods import Request, SendPhoto from tests.mocked_bot import MockedBot @@ -9,9 +10,7 @@ class TestSendPhoto: async def test_method(self, bot: MockedBot): prepare_result = bot.add_result_for(SendPhoto, ok=True, result=None) - response: Message = await SendPhoto( - chat_id=..., photo=..., - ) + response: Message = await SendPhoto(chat_id=..., photo=...) request: Request = bot.get_request() assert request.method == "sendPhoto" # assert request.data == {} @@ -21,9 +20,7 @@ class TestSendPhoto: async def test_bot_method(self, bot: MockedBot): prepare_result = bot.add_result_for(SendPhoto, ok=True, result=None) - response: Message = await bot.send_photo( - chat_id=..., photo=..., - ) + response: Message = await bot.send_photo(chat_id=..., photo=...) request: Request = bot.get_request() assert request.method == "sendPhoto" # assert request.data == {} diff --git a/tests/test_api/test_methods/test_send_poll.py b/tests/test_api/test_methods/test_send_poll.py index bdcded0e..d7a96ab1 100644 --- a/tests/test_api/test_methods/test_send_poll.py +++ b/tests/test_api/test_methods/test_send_poll.py @@ -1,4 +1,5 @@ import pytest + from aiogram.api.methods import Request, SendPoll from tests.mocked_bot import MockedBot @@ -9,9 +10,7 @@ class TestSendPoll: async def test_method(self, bot: MockedBot): prepare_result = bot.add_result_for(SendPoll, ok=True, result=None) - response: Message = await SendPoll( - chat_id=..., question=..., options=..., - ) + response: Message = await SendPoll(chat_id=..., question=..., options=...) request: Request = bot.get_request() assert request.method == "sendPoll" # assert request.data == {} @@ -21,9 +20,7 @@ class TestSendPoll: async def test_bot_method(self, bot: MockedBot): prepare_result = bot.add_result_for(SendPoll, ok=True, result=None) - response: Message = await bot.send_poll( - chat_id=..., question=..., options=..., - ) + response: Message = await bot.send_poll(chat_id=..., question=..., options=...) request: Request = bot.get_request() assert request.method == "sendPoll" # assert request.data == {} diff --git a/tests/test_api/test_methods/test_send_sticker.py b/tests/test_api/test_methods/test_send_sticker.py index e5d68b4f..81a4e345 100644 --- a/tests/test_api/test_methods/test_send_sticker.py +++ b/tests/test_api/test_methods/test_send_sticker.py @@ -1,4 +1,5 @@ import pytest + from aiogram.api.methods import Request, SendSticker from tests.mocked_bot import MockedBot @@ -9,9 +10,7 @@ class TestSendSticker: async def test_method(self, bot: MockedBot): prepare_result = bot.add_result_for(SendSticker, ok=True, result=None) - response: Message = await SendSticker( - chat_id=..., sticker=..., - ) + response: Message = await SendSticker(chat_id=..., sticker=...) request: Request = bot.get_request() assert request.method == "sendSticker" # assert request.data == {} @@ -21,9 +20,7 @@ class TestSendSticker: async def test_bot_method(self, bot: MockedBot): prepare_result = bot.add_result_for(SendSticker, ok=True, result=None) - response: Message = await bot.send_sticker( - chat_id=..., sticker=..., - ) + response: Message = await bot.send_sticker(chat_id=..., sticker=...) request: Request = bot.get_request() assert request.method == "sendSticker" # assert request.data == {} diff --git a/tests/test_api/test_methods/test_send_venue.py b/tests/test_api/test_methods/test_send_venue.py index 18f56024..f2d09cea 100644 --- a/tests/test_api/test_methods/test_send_venue.py +++ b/tests/test_api/test_methods/test_send_venue.py @@ -1,4 +1,5 @@ import pytest + from aiogram.api.methods import Request, SendVenue from tests.mocked_bot import MockedBot @@ -10,7 +11,7 @@ class TestSendVenue: prepare_result = bot.add_result_for(SendVenue, ok=True, result=None) response: Message = await SendVenue( - chat_id=..., latitude=..., longitude=..., title=..., address=..., + chat_id=..., latitude=..., longitude=..., title=..., address=... ) request: Request = bot.get_request() assert request.method == "sendVenue" @@ -22,7 +23,7 @@ class TestSendVenue: prepare_result = bot.add_result_for(SendVenue, ok=True, result=None) response: Message = await bot.send_venue( - chat_id=..., latitude=..., longitude=..., title=..., address=..., + chat_id=..., latitude=..., longitude=..., title=..., address=... ) request: Request = bot.get_request() assert request.method == "sendVenue" diff --git a/tests/test_api/test_methods/test_send_video.py b/tests/test_api/test_methods/test_send_video.py index cfcacfd4..ea3c9220 100644 --- a/tests/test_api/test_methods/test_send_video.py +++ b/tests/test_api/test_methods/test_send_video.py @@ -1,4 +1,5 @@ import pytest + from aiogram.api.methods import Request, SendVideo from tests.mocked_bot import MockedBot @@ -9,9 +10,7 @@ class TestSendVideo: async def test_method(self, bot: MockedBot): prepare_result = bot.add_result_for(SendVideo, ok=True, result=None) - response: Message = await SendVideo( - chat_id=..., video=..., - ) + response: Message = await SendVideo(chat_id=..., video=...) request: Request = bot.get_request() assert request.method == "sendVideo" # assert request.data == {} @@ -21,9 +20,7 @@ class TestSendVideo: async def test_bot_method(self, bot: MockedBot): prepare_result = bot.add_result_for(SendVideo, ok=True, result=None) - response: Message = await bot.send_video( - chat_id=..., video=..., - ) + response: Message = await bot.send_video(chat_id=..., video=...) request: Request = bot.get_request() assert request.method == "sendVideo" # assert request.data == {} diff --git a/tests/test_api/test_methods/test_send_video_note.py b/tests/test_api/test_methods/test_send_video_note.py index 4d19d62a..e5b27f68 100644 --- a/tests/test_api/test_methods/test_send_video_note.py +++ b/tests/test_api/test_methods/test_send_video_note.py @@ -1,4 +1,5 @@ import pytest + from aiogram.api.methods import Request, SendVideoNote from tests.mocked_bot import MockedBot @@ -9,9 +10,7 @@ class TestSendVideoNote: async def test_method(self, bot: MockedBot): prepare_result = bot.add_result_for(SendVideoNote, ok=True, result=None) - response: Message = await SendVideoNote( - chat_id=..., video_note=..., - ) + response: Message = await SendVideoNote(chat_id=..., video_note=...) request: Request = bot.get_request() assert request.method == "sendVideoNote" # assert request.data == {} @@ -21,9 +20,7 @@ class TestSendVideoNote: async def test_bot_method(self, bot: MockedBot): prepare_result = bot.add_result_for(SendVideoNote, ok=True, result=None) - response: Message = await bot.send_video_note( - chat_id=..., video_note=..., - ) + response: Message = await bot.send_video_note(chat_id=..., video_note=...) request: Request = bot.get_request() assert request.method == "sendVideoNote" # assert request.data == {} diff --git a/tests/test_api/test_methods/test_send_voice.py b/tests/test_api/test_methods/test_send_voice.py index 6ee4fd2b..2bed25b6 100644 --- a/tests/test_api/test_methods/test_send_voice.py +++ b/tests/test_api/test_methods/test_send_voice.py @@ -1,4 +1,5 @@ import pytest + from aiogram.api.methods import Request, SendVoice from tests.mocked_bot import MockedBot @@ -9,9 +10,7 @@ class TestSendVoice: async def test_method(self, bot: MockedBot): prepare_result = bot.add_result_for(SendVoice, ok=True, result=None) - response: Message = await SendVoice( - chat_id=..., voice=..., - ) + response: Message = await SendVoice(chat_id=..., voice=...) request: Request = bot.get_request() assert request.method == "sendVoice" # assert request.data == {} @@ -21,9 +20,7 @@ class TestSendVoice: async def test_bot_method(self, bot: MockedBot): prepare_result = bot.add_result_for(SendVoice, ok=True, result=None) - response: Message = await bot.send_voice( - chat_id=..., voice=..., - ) + response: Message = await bot.send_voice(chat_id=..., voice=...) request: Request = bot.get_request() assert request.method == "sendVoice" # assert request.data == {} diff --git a/tests/test_api/test_methods/test_set_chat_description.py b/tests/test_api/test_methods/test_set_chat_description.py index c889995c..8ac46632 100644 --- a/tests/test_api/test_methods/test_set_chat_description.py +++ b/tests/test_api/test_methods/test_set_chat_description.py @@ -1,4 +1,5 @@ import pytest + from aiogram.api.methods import Request, SetChatDescription from tests.mocked_bot import MockedBot @@ -9,7 +10,7 @@ class TestSetChatDescription: async def test_method(self, bot: MockedBot): prepare_result = bot.add_result_for(SetChatDescription, ok=True, result=None) - response: bool = await SetChatDescription(chat_id=...,) + response: bool = await SetChatDescription(chat_id=...) request: Request = bot.get_request() assert request.method == "setChatDescription" # assert request.data == {} @@ -19,7 +20,7 @@ class TestSetChatDescription: async def test_bot_method(self, bot: MockedBot): prepare_result = bot.add_result_for(SetChatDescription, ok=True, result=None) - response: bool = await bot.set_chat_description(chat_id=...,) + response: bool = await bot.set_chat_description(chat_id=...) request: Request = bot.get_request() assert request.method == "setChatDescription" # assert request.data == {} diff --git a/tests/test_api/test_methods/test_set_chat_permissions.py b/tests/test_api/test_methods/test_set_chat_permissions.py index 4d1692f8..933ed677 100644 --- a/tests/test_api/test_methods/test_set_chat_permissions.py +++ b/tests/test_api/test_methods/test_set_chat_permissions.py @@ -1,4 +1,5 @@ import pytest + from aiogram.api.methods import Request, SetChatPermissions from tests.mocked_bot import MockedBot @@ -9,9 +10,7 @@ class TestSetChatPermissions: async def test_method(self, bot: MockedBot): prepare_result = bot.add_result_for(SetChatPermissions, ok=True, result=None) - response: bool = await SetChatPermissions( - chat_id=..., permissions=..., - ) + response: bool = await SetChatPermissions(chat_id=..., permissions=...) request: Request = bot.get_request() assert request.method == "setChatPermissions" # assert request.data == {} @@ -21,9 +20,7 @@ class TestSetChatPermissions: async def test_bot_method(self, bot: MockedBot): prepare_result = bot.add_result_for(SetChatPermissions, ok=True, result=None) - response: bool = await bot.set_chat_permissions( - chat_id=..., permissions=..., - ) + response: bool = await bot.set_chat_permissions(chat_id=..., permissions=...) request: Request = bot.get_request() assert request.method == "setChatPermissions" # assert request.data == {} diff --git a/tests/test_api/test_methods/test_set_chat_photo.py b/tests/test_api/test_methods/test_set_chat_photo.py index 52ec7646..ce20f997 100644 --- a/tests/test_api/test_methods/test_set_chat_photo.py +++ b/tests/test_api/test_methods/test_set_chat_photo.py @@ -1,4 +1,5 @@ import pytest + from aiogram.api.methods import Request, SetChatPhoto from tests.mocked_bot import MockedBot @@ -9,9 +10,7 @@ class TestSetChatPhoto: async def test_method(self, bot: MockedBot): prepare_result = bot.add_result_for(SetChatPhoto, ok=True, result=None) - response: bool = await SetChatPhoto( - chat_id=..., photo=..., - ) + response: bool = await SetChatPhoto(chat_id=..., photo=...) request: Request = bot.get_request() assert request.method == "setChatPhoto" # assert request.data == {} @@ -21,9 +20,7 @@ class TestSetChatPhoto: async def test_bot_method(self, bot: MockedBot): prepare_result = bot.add_result_for(SetChatPhoto, ok=True, result=None) - response: bool = await bot.set_chat_photo( - chat_id=..., photo=..., - ) + response: bool = await bot.set_chat_photo(chat_id=..., photo=...) request: Request = bot.get_request() assert request.method == "setChatPhoto" # assert request.data == {} diff --git a/tests/test_api/test_methods/test_set_chat_sticker_set.py b/tests/test_api/test_methods/test_set_chat_sticker_set.py index ab73950d..c8b0108e 100644 --- a/tests/test_api/test_methods/test_set_chat_sticker_set.py +++ b/tests/test_api/test_methods/test_set_chat_sticker_set.py @@ -1,4 +1,5 @@ import pytest + from aiogram.api.methods import Request, SetChatStickerSet from tests.mocked_bot import MockedBot @@ -9,9 +10,7 @@ class TestSetChatStickerSet: async def test_method(self, bot: MockedBot): prepare_result = bot.add_result_for(SetChatStickerSet, ok=True, result=None) - response: bool = await SetChatStickerSet( - chat_id=..., sticker_set_name=..., - ) + response: bool = await SetChatStickerSet(chat_id=..., sticker_set_name=...) request: Request = bot.get_request() assert request.method == "setChatStickerSet" # assert request.data == {} @@ -21,9 +20,7 @@ class TestSetChatStickerSet: async def test_bot_method(self, bot: MockedBot): prepare_result = bot.add_result_for(SetChatStickerSet, ok=True, result=None) - response: bool = await bot.set_chat_sticker_set( - chat_id=..., sticker_set_name=..., - ) + response: bool = await bot.set_chat_sticker_set(chat_id=..., sticker_set_name=...) request: Request = bot.get_request() assert request.method == "setChatStickerSet" # assert request.data == {} diff --git a/tests/test_api/test_methods/test_set_chat_title.py b/tests/test_api/test_methods/test_set_chat_title.py index 58e3e9ca..cce2b768 100644 --- a/tests/test_api/test_methods/test_set_chat_title.py +++ b/tests/test_api/test_methods/test_set_chat_title.py @@ -1,4 +1,5 @@ import pytest + from aiogram.api.methods import Request, SetChatTitle from tests.mocked_bot import MockedBot @@ -9,9 +10,7 @@ class TestSetChatTitle: async def test_method(self, bot: MockedBot): prepare_result = bot.add_result_for(SetChatTitle, ok=True, result=None) - response: bool = await SetChatTitle( - chat_id=..., title=..., - ) + response: bool = await SetChatTitle(chat_id=..., title=...) request: Request = bot.get_request() assert request.method == "setChatTitle" # assert request.data == {} @@ -21,9 +20,7 @@ class TestSetChatTitle: async def test_bot_method(self, bot: MockedBot): prepare_result = bot.add_result_for(SetChatTitle, ok=True, result=None) - response: bool = await bot.set_chat_title( - chat_id=..., title=..., - ) + response: bool = await bot.set_chat_title(chat_id=..., title=...) request: Request = bot.get_request() assert request.method == "setChatTitle" # assert request.data == {} diff --git a/tests/test_api/test_methods/test_set_game_score.py b/tests/test_api/test_methods/test_set_game_score.py index 631eaf06..27183a7d 100644 --- a/tests/test_api/test_methods/test_set_game_score.py +++ b/tests/test_api/test_methods/test_set_game_score.py @@ -1,4 +1,5 @@ import pytest + from aiogram.api.methods import Request, SetGameScore from tests.mocked_bot import MockedBot @@ -9,9 +10,7 @@ class TestSetGameScore: async def test_method(self, bot: MockedBot): prepare_result = bot.add_result_for(SetGameScore, ok=True, result=None) - response: Union[Message, bool] = await SetGameScore( - user_id=..., score=..., - ) + response: Union[Message, bool] = await SetGameScore(user_id=..., score=...) request: Request = bot.get_request() assert request.method == "setGameScore" # assert request.data == {} @@ -21,9 +20,7 @@ class TestSetGameScore: async def test_bot_method(self, bot: MockedBot): prepare_result = bot.add_result_for(SetGameScore, ok=True, result=None) - response: Union[Message, bool] = await bot.set_game_score( - user_id=..., score=..., - ) + response: Union[Message, bool] = await bot.set_game_score(user_id=..., score=...) request: Request = bot.get_request() assert request.method == "setGameScore" # assert request.data == {} diff --git a/tests/test_api/test_methods/test_set_passport_data_errors.py b/tests/test_api/test_methods/test_set_passport_data_errors.py index 7e479c1f..fe74df09 100644 --- a/tests/test_api/test_methods/test_set_passport_data_errors.py +++ b/tests/test_api/test_methods/test_set_passport_data_errors.py @@ -1,4 +1,5 @@ import pytest + from aiogram.api.methods import Request, SetPassportDataErrors from tests.mocked_bot import MockedBot @@ -9,9 +10,7 @@ class TestSetPassportDataErrors: async def test_method(self, bot: MockedBot): prepare_result = bot.add_result_for(SetPassportDataErrors, ok=True, result=None) - response: bool = await SetPassportDataErrors( - user_id=..., errors=..., - ) + response: bool = await SetPassportDataErrors(user_id=..., errors=...) request: Request = bot.get_request() assert request.method == "setPassportDataErrors" # assert request.data == {} @@ -21,9 +20,7 @@ class TestSetPassportDataErrors: async def test_bot_method(self, bot: MockedBot): prepare_result = bot.add_result_for(SetPassportDataErrors, ok=True, result=None) - response: bool = await bot.set_passport_data_errors( - user_id=..., errors=..., - ) + response: bool = await bot.set_passport_data_errors(user_id=..., errors=...) request: Request = bot.get_request() assert request.method == "setPassportDataErrors" # assert request.data == {} diff --git a/tests/test_api/test_methods/test_set_sticker_position_in_set.py b/tests/test_api/test_methods/test_set_sticker_position_in_set.py index bf589b74..a31f7920 100644 --- a/tests/test_api/test_methods/test_set_sticker_position_in_set.py +++ b/tests/test_api/test_methods/test_set_sticker_position_in_set.py @@ -1,4 +1,5 @@ import pytest + from aiogram.api.methods import Request, SetStickerPositionInSet from tests.mocked_bot import MockedBot @@ -9,9 +10,7 @@ class TestSetStickerPositionInSet: async def test_method(self, bot: MockedBot): prepare_result = bot.add_result_for(SetStickerPositionInSet, ok=True, result=None) - response: bool = await SetStickerPositionInSet( - sticker=..., position=..., - ) + response: bool = await SetStickerPositionInSet(sticker=..., position=...) request: Request = bot.get_request() assert request.method == "setStickerPositionInSet" # assert request.data == {} @@ -21,9 +20,7 @@ class TestSetStickerPositionInSet: async def test_bot_method(self, bot: MockedBot): prepare_result = bot.add_result_for(SetStickerPositionInSet, ok=True, result=None) - response: bool = await bot.set_sticker_position_in_set( - sticker=..., position=..., - ) + response: bool = await bot.set_sticker_position_in_set(sticker=..., position=...) request: Request = bot.get_request() assert request.method == "setStickerPositionInSet" # assert request.data == {} diff --git a/tests/test_api/test_methods/test_set_webhook.py b/tests/test_api/test_methods/test_set_webhook.py index e42743e0..cccee5d3 100644 --- a/tests/test_api/test_methods/test_set_webhook.py +++ b/tests/test_api/test_methods/test_set_webhook.py @@ -1,4 +1,5 @@ import pytest + from aiogram.api.methods import Request, SetWebhook from tests.mocked_bot import MockedBot @@ -9,7 +10,7 @@ class TestSetWebhook: async def test_method(self, bot: MockedBot): prepare_result = bot.add_result_for(SetWebhook, ok=True, result=None) - response: bool = await SetWebhook(url=...,) + response: bool = await SetWebhook(url=...) request: Request = bot.get_request() assert request.method == "setWebhook" # assert request.data == {} @@ -19,7 +20,7 @@ class TestSetWebhook: async def test_bot_method(self, bot: MockedBot): prepare_result = bot.add_result_for(SetWebhook, ok=True, result=None) - response: bool = await bot.set_webhook(url=...,) + response: bool = await bot.set_webhook(url=...) request: Request = bot.get_request() assert request.method == "setWebhook" # assert request.data == {} diff --git a/tests/test_api/test_methods/test_stop_message_live_location.py b/tests/test_api/test_methods/test_stop_message_live_location.py index 7ff8ecf1..e7d927c2 100644 --- a/tests/test_api/test_methods/test_stop_message_live_location.py +++ b/tests/test_api/test_methods/test_stop_message_live_location.py @@ -1,4 +1,5 @@ import pytest + from aiogram.api.methods import Request, StopMessageLiveLocation from tests.mocked_bot import MockedBot diff --git a/tests/test_api/test_methods/test_stop_poll.py b/tests/test_api/test_methods/test_stop_poll.py index a47b49f5..5141d2c4 100644 --- a/tests/test_api/test_methods/test_stop_poll.py +++ b/tests/test_api/test_methods/test_stop_poll.py @@ -1,4 +1,5 @@ import pytest + from aiogram.api.methods import Request, StopPoll from tests.mocked_bot import MockedBot @@ -9,9 +10,7 @@ class TestStopPoll: async def test_method(self, bot: MockedBot): prepare_result = bot.add_result_for(StopPoll, ok=True, result=None) - response: Poll = await StopPoll( - chat_id=..., message_id=..., - ) + response: Poll = await StopPoll(chat_id=..., message_id=...) request: Request = bot.get_request() assert request.method == "stopPoll" # assert request.data == {} @@ -21,9 +20,7 @@ class TestStopPoll: async def test_bot_method(self, bot: MockedBot): prepare_result = bot.add_result_for(StopPoll, ok=True, result=None) - response: Poll = await bot.stop_poll( - chat_id=..., message_id=..., - ) + response: Poll = await bot.stop_poll(chat_id=..., message_id=...) request: Request = bot.get_request() assert request.method == "stopPoll" # assert request.data == {} diff --git a/tests/test_api/test_methods/test_unban_chat_member.py b/tests/test_api/test_methods/test_unban_chat_member.py index 84ed8573..9ca14ad2 100644 --- a/tests/test_api/test_methods/test_unban_chat_member.py +++ b/tests/test_api/test_methods/test_unban_chat_member.py @@ -1,4 +1,5 @@ import pytest + from aiogram.api.methods import Request, UnbanChatMember from tests.mocked_bot import MockedBot @@ -9,9 +10,7 @@ class TestUnbanChatMember: async def test_method(self, bot: MockedBot): prepare_result = bot.add_result_for(UnbanChatMember, ok=True, result=None) - response: bool = await UnbanChatMember( - chat_id=..., user_id=..., - ) + response: bool = await UnbanChatMember(chat_id=..., user_id=...) request: Request = bot.get_request() assert request.method == "unbanChatMember" # assert request.data == {} @@ -21,9 +20,7 @@ class TestUnbanChatMember: async def test_bot_method(self, bot: MockedBot): prepare_result = bot.add_result_for(UnbanChatMember, ok=True, result=None) - response: bool = await bot.unban_chat_member( - chat_id=..., user_id=..., - ) + response: bool = await bot.unban_chat_member(chat_id=..., user_id=...) request: Request = bot.get_request() assert request.method == "unbanChatMember" # assert request.data == {} diff --git a/tests/test_api/test_methods/test_unpin_chat_message.py b/tests/test_api/test_methods/test_unpin_chat_message.py index e439178b..a12efeab 100644 --- a/tests/test_api/test_methods/test_unpin_chat_message.py +++ b/tests/test_api/test_methods/test_unpin_chat_message.py @@ -1,4 +1,5 @@ import pytest + from aiogram.api.methods import Request, UnpinChatMessage from tests.mocked_bot import MockedBot @@ -9,7 +10,7 @@ class TestUnpinChatMessage: async def test_method(self, bot: MockedBot): prepare_result = bot.add_result_for(UnpinChatMessage, ok=True, result=None) - response: bool = await UnpinChatMessage(chat_id=...,) + response: bool = await UnpinChatMessage(chat_id=...) request: Request = bot.get_request() assert request.method == "unpinChatMessage" # assert request.data == {} @@ -19,7 +20,7 @@ class TestUnpinChatMessage: async def test_bot_method(self, bot: MockedBot): prepare_result = bot.add_result_for(UnpinChatMessage, ok=True, result=None) - response: bool = await bot.unpin_chat_message(chat_id=...,) + response: bool = await bot.unpin_chat_message(chat_id=...) request: Request = bot.get_request() assert request.method == "unpinChatMessage" # assert request.data == {} diff --git a/tests/test_api/test_methods/test_upload_sticker_file.py b/tests/test_api/test_methods/test_upload_sticker_file.py index f19664fd..1a24522d 100644 --- a/tests/test_api/test_methods/test_upload_sticker_file.py +++ b/tests/test_api/test_methods/test_upload_sticker_file.py @@ -1,4 +1,5 @@ import pytest + from aiogram.api.methods import Request, UploadStickerFile from tests.mocked_bot import MockedBot @@ -9,9 +10,7 @@ class TestUploadStickerFile: async def test_method(self, bot: MockedBot): prepare_result = bot.add_result_for(UploadStickerFile, ok=True, result=None) - response: File = await UploadStickerFile( - user_id=..., png_sticker=..., - ) + response: File = await UploadStickerFile(user_id=..., png_sticker=...) request: Request = bot.get_request() assert request.method == "uploadStickerFile" # assert request.data == {} @@ -21,9 +20,7 @@ class TestUploadStickerFile: async def test_bot_method(self, bot: MockedBot): prepare_result = bot.add_result_for(UploadStickerFile, ok=True, result=None) - response: File = await bot.upload_sticker_file( - user_id=..., png_sticker=..., - ) + response: File = await bot.upload_sticker_file(user_id=..., png_sticker=...) request: Request = bot.get_request() assert request.method == "uploadStickerFile" # assert request.data == {}