From 422770c2af91f8286a9102227d891fc0695747dc Mon Sep 17 00:00:00 2001 From: Suren Khorenyan Date: Sat, 30 Dec 2023 23:57:25 +0300 Subject: [PATCH] add tests coverage for Message.react --- tests/test_api/test_types/test_message.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/test_api/test_types/test_message.py b/tests/test_api/test_types/test_message.py index 7efe6c89..69f9d8b8 100644 --- a/tests/test_api/test_types/test_message.py +++ b/tests/test_api/test_types/test_message.py @@ -31,6 +31,7 @@ from aiogram.methods import ( SendVideo, SendVideoNote, SendVoice, + SetMessageReaction, StopMessageLiveLocation, TelegramMethod, UnpinChatMessage, @@ -62,6 +63,7 @@ from aiogram.types import ( Poll, PollOption, ProximityAlertTriggered, + ReactionTypeCustomEmoji, Sticker, Story, SuccessfulPayment, @@ -861,6 +863,20 @@ class TestMessage: assert isinstance(method, UnpinChatMessage) assert method.chat_id == message.chat.id + def test_react(self): + message = Message( + message_id=777, + chat=Chat(id=-42, type="channel"), + date=datetime.datetime.now(), + ) + emoji_reaction = ReactionTypeCustomEmoji(custom_emoji_id="qwerty") + method = message.react( + reaction=[emoji_reaction], + ) + assert isinstance(method, SetMessageReaction) + assert method.chat_id == message.chat.id + assert method.reaction == [emoji_reaction] + @pytest.mark.parametrize( "text,entities,mode,expected_value", [