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 19fb9626..648959a6 100644 --- a/tests/test_api/test_methods/test_edit_message_caption.py +++ b/tests/test_api/test_methods/test_edit_message_caption.py @@ -11,11 +11,7 @@ from tests.mocked_bot import MockedBot class TestEditMessageCaption: @pytest.mark.asyncio async def test_method(self, bot: MockedBot): - prepare_result = bot.add_result_for( - EditMessageCaption, - ok=True, - result=MessageFactory(), - ) + prepare_result = bot.add_result_for(EditMessageCaption, ok=True, result=MessageFactory()) response: Union[Message, bool] = await EditMessageCaption() request: Request = bot.get_request() @@ -24,11 +20,7 @@ class TestEditMessageCaption: @pytest.mark.asyncio async def test_bot_method(self, bot: MockedBot): - prepare_result = bot.add_result_for( - EditMessageCaption, - ok=True, - result=MessageFactory(), - ) + prepare_result = bot.add_result_for(EditMessageCaption, ok=True, result=MessageFactory()) response: Union[Message, bool] = await bot.edit_message_caption() request: Request = bot.get_request() diff --git a/tests/test_api/test_methods/test_forward_message.py b/tests/test_api/test_methods/test_forward_message.py index b7a0b13f..15d4557b 100644 --- a/tests/test_api/test_methods/test_forward_message.py +++ b/tests/test_api/test_methods/test_forward_message.py @@ -11,12 +11,7 @@ from tests.mocked_bot import MockedBot class TestForwardMessage: @pytest.mark.asyncio async def test_method(self, bot: MockedBot, private_chat: Chat): - prepare_result = bot.add_result_for( - ForwardMessage, - ok=True, - result=MessageFactory( - ), - ) + prepare_result = bot.add_result_for(ForwardMessage, ok=True, result=MessageFactory()) response: Message = await ForwardMessage( chat_id=private_chat.id, from_chat_id=private_chat.id, message_id=42 @@ -28,12 +23,7 @@ class TestForwardMessage: @pytest.mark.asyncio async def test_bot_method(self, bot: MockedBot, private_chat: Chat): - prepare_result = bot.add_result_for( - ForwardMessage, - ok=True, - result=MessageFactory( - ), - ) + prepare_result = bot.add_result_for(ForwardMessage, ok=True, result=MessageFactory()) response: Message = await bot.forward_message( chat_id=private_chat.id, from_chat_id=private_chat.id, message_id=42 diff --git a/tests/test_api/test_methods/test_send_animation.py b/tests/test_api/test_methods/test_send_animation.py index 85bb4380..da869fd4 100644 --- a/tests/test_api/test_methods/test_send_animation.py +++ b/tests/test_api/test_methods/test_send_animation.py @@ -17,7 +17,7 @@ class TestSendAnimation: result=MessageFactory( animation=Animation( file_id="file id", width=42, height=42, duration=0, file_unique_id="file id" - ), + ) ), ) @@ -34,7 +34,7 @@ class TestSendAnimation: result=MessageFactory( animation=Animation( file_id="file id", width=42, height=42, duration=0, file_unique_id="file id" - ), + ) ), ) diff --git a/tests/test_api/test_methods/test_send_audio.py b/tests/test_api/test_methods/test_send_audio.py index a29fa896..a5305a3f 100644 --- a/tests/test_api/test_methods/test_send_audio.py +++ b/tests/test_api/test_methods/test_send_audio.py @@ -15,7 +15,7 @@ class TestSendAudio: SendAudio, ok=True, result=MessageFactory( - audio=Audio(file_id="file id", duration=42, file_unique_id="file id"), + audio=Audio(file_id="file id", duration=42, file_unique_id="file id") ), ) @@ -30,7 +30,7 @@ class TestSendAudio: SendAudio, ok=True, result=MessageFactory( - audio=Audio(file_id="file id", duration=42, file_unique_id="file id"), + audio=Audio(file_id="file id", duration=42, file_unique_id="file id") ), ) diff --git a/tests/test_api/test_methods/test_send_contact.py b/tests/test_api/test_methods/test_send_contact.py index b42c36c4..a6370d84 100644 --- a/tests/test_api/test_methods/test_send_contact.py +++ b/tests/test_api/test_methods/test_send_contact.py @@ -12,9 +12,7 @@ class TestSendContact: prepare_result = bot.add_result_for( SendContact, ok=True, - result=MessageFactory( - contact=Contact(phone_number="911", first_name="911"), - ), + result=MessageFactory(contact=Contact(phone_number="911", first_name="911")), ) response: Message = await SendContact( @@ -29,9 +27,7 @@ class TestSendContact: prepare_result = bot.add_result_for( SendContact, ok=True, - result=MessageFactory( - contact=Contact(phone_number="911", first_name="911"), - ), + result=MessageFactory(contact=Contact(phone_number="911", first_name="911")), ) response: Message = await bot.send_contact( diff --git a/tests/test_api/test_methods/test_send_document.py b/tests/test_api/test_methods/test_send_document.py index 50ecaf5f..cfc2921c 100644 --- a/tests/test_api/test_methods/test_send_document.py +++ b/tests/test_api/test_methods/test_send_document.py @@ -14,9 +14,7 @@ class TestSendDocument: prepare_result = bot.add_result_for( SendDocument, ok=True, - result=MessageFactory( - document=Document(file_id="file id", file_unique_id="file id"), - ), + result=MessageFactory(document=Document(file_id="file id", file_unique_id="file id")), ) response: Message = await SendDocument(chat_id=private_chat.id, document="file id") @@ -29,9 +27,7 @@ class TestSendDocument: prepare_result = bot.add_result_for( SendDocument, ok=True, - result=MessageFactory( - document=Document(file_id="file id", file_unique_id="file id"), - ), + result=MessageFactory(document=Document(file_id="file id", file_unique_id="file id")), ) response: Message = await bot.send_document(chat_id=private_chat.id, document="file id") diff --git a/tests/test_api/test_methods/test_send_game.py b/tests/test_api/test_methods/test_send_game.py index 55e8460d..704bc0d9 100644 --- a/tests/test_api/test_methods/test_send_game.py +++ b/tests/test_api/test_methods/test_send_game.py @@ -21,7 +21,7 @@ class TestSendGame: photo=[ PhotoSize(file_id="file id", width=42, height=42, file_unique_id="file id") ], - ), + ) ), ) @@ -42,7 +42,7 @@ class TestSendGame: photo=[ PhotoSize(file_id="file id", width=42, height=42, file_unique_id="file id") ], - ), + ) ), ) diff --git a/tests/test_api/test_methods/test_send_invoice.py b/tests/test_api/test_methods/test_send_invoice.py index c0e12dcd..e4809d9a 100644 --- a/tests/test_api/test_methods/test_send_invoice.py +++ b/tests/test_api/test_methods/test_send_invoice.py @@ -19,7 +19,7 @@ class TestSendInvoice: start_parameter="brilliant", currency="BTC", total_amount=1, - ), + ) ), ) @@ -49,7 +49,7 @@ class TestSendInvoice: start_parameter="brilliant", currency="BTC", total_amount=1, - ), + ) ), ) diff --git a/tests/test_api/test_methods/test_send_location.py b/tests/test_api/test_methods/test_send_location.py index 7114afd6..1078fa4c 100644 --- a/tests/test_api/test_methods/test_send_location.py +++ b/tests/test_api/test_methods/test_send_location.py @@ -14,9 +14,7 @@ class TestSendLocation: prepare_result = bot.add_result_for( SendLocation, ok=True, - result=MessageFactory( - location=Location(longitude=3.14, latitude=3.14), - ), + result=MessageFactory(location=Location(longitude=3.14, latitude=3.14)), ) response: Message = await SendLocation( @@ -31,9 +29,7 @@ class TestSendLocation: prepare_result = bot.add_result_for( SendLocation, ok=True, - result=MessageFactory( - location=Location(longitude=3.14, latitude=3.14), - ), + result=MessageFactory(location=Location(longitude=3.14, latitude=3.14)), ) response: Message = await bot.send_location( diff --git a/tests/test_api/test_methods/test_send_message.py b/tests/test_api/test_methods/test_send_message.py index 02989c9c..c5749d81 100644 --- a/tests/test_api/test_methods/test_send_message.py +++ b/tests/test_api/test_methods/test_send_message.py @@ -11,12 +11,7 @@ from tests.mocked_bot import MockedBot class TestSendMessage: @pytest.mark.asyncio async def test_method(self, bot: MockedBot): - prepare_result = bot.add_result_for( - SendMessage, - ok=True, - result=MessageFactory( - ), - ) + prepare_result = bot.add_result_for(SendMessage, ok=True, result=MessageFactory()) response: Message = await SendMessage(chat_id=42, text="test") request: Request = bot.get_request() @@ -25,12 +20,7 @@ class TestSendMessage: @pytest.mark.asyncio async def test_bot_method(self, bot: MockedBot): - prepare_result = bot.add_result_for( - SendMessage, - ok=True, - result=MessageFactory( - ), - ) + prepare_result = bot.add_result_for(SendMessage, ok=True, result=MessageFactory()) response: Message = await bot.send_message(chat_id=42, text="test") request: Request = bot.get_request() diff --git a/tests/test_api/test_methods/test_send_photo.py b/tests/test_api/test_methods/test_send_photo.py index e737924a..cc789d57 100644 --- a/tests/test_api/test_methods/test_send_photo.py +++ b/tests/test_api/test_methods/test_send_photo.py @@ -13,9 +13,7 @@ class TestSendPhoto: SendPhoto, ok=True, result=MessageFactory( - photo=[ - PhotoSize(file_id="file id", width=42, height=42, file_unique_id="file id") - ], + photo=[PhotoSize(file_id="file id", width=42, height=42, file_unique_id="file id")] ), ) @@ -30,9 +28,7 @@ class TestSendPhoto: SendPhoto, ok=True, result=MessageFactory( - photo=[ - PhotoSize(file_id="file id", width=42, height=42, file_unique_id="file id") - ], + photo=[PhotoSize(file_id="file id", width=42, height=42, file_unique_id="file id")] ), ) diff --git a/tests/test_api/test_methods/test_send_poll.py b/tests/test_api/test_methods/test_send_poll.py index fdfc8e3d..ac15cadd 100644 --- a/tests/test_api/test_methods/test_send_poll.py +++ b/tests/test_api/test_methods/test_send_poll.py @@ -30,12 +30,16 @@ class TestSendPoll: total_voter_count=0, correct_option_id=0, ), - chat=private_chat + chat=private_chat, ), ) response: Message = await SendPoll( - chat_id=private_chat.id, question="Q?", options=["A", "B"], correct_option_id=0, type="quiz" + chat_id=private_chat.id, + question="Q?", + options=["A", "B"], + correct_option_id=0, + type="quiz", ) request: Request = bot.get_request() assert request.method == "sendPoll" @@ -61,12 +65,16 @@ class TestSendPoll: total_voter_count=0, correct_option_id=0, ), - chat=private_chat + chat=private_chat, ), ) response: Message = await bot.send_poll( - chat_id=private_chat.id, question="Q?", options=["A", "B"], correct_option_id=0, type="quiz" + chat_id=private_chat.id, + question="Q?", + options=["A", "B"], + correct_option_id=0, + type="quiz", ) request: Request = bot.get_request() assert request.method == "sendPoll" diff --git a/tests/test_dispatcher/test_handler/test_message.py b/tests/test_dispatcher/test_handler/test_message.py index bf352b7d..18455708 100644 --- a/tests/test_dispatcher/test_handler/test_message.py +++ b/tests/test_dispatcher/test_handler/test_message.py @@ -15,8 +15,7 @@ class MyHandler(MessageHandler): class TestClassBasedMessageHandler: @pytest.mark.asyncio async def test_message_handler(self): - event = MessageFactory( - ) + event = MessageFactory() handler = MyHandler(event=event) assert handler.from_user == event.from_user @@ -31,9 +30,7 @@ class HandlerWithCommand(MessageHandlerCommandMixin, MessageHandler): class TestBaseMessageHandlerCommandMixin: def test_command_accessible(self): handler = HandlerWithCommand( - MessageFactory( - text="/test args", - ), + MessageFactory(text="/test args"), command=CommandObject(prefix="/", command="command", args="args"), ) @@ -41,8 +38,6 @@ class TestBaseMessageHandlerCommandMixin: assert handler.command.command == "command" def test_command_not_presented(self): - handler = HandlerWithCommand( - MessageFactory() - ) + handler = HandlerWithCommand(MessageFactory()) assert handler.command is None