mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
add tests coverage for Message.react
This commit is contained in:
parent
b7c1bfe81f
commit
422770c2af
1 changed files with 16 additions and 0 deletions
|
|
@ -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",
|
||||
[
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue