mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Add set_chat_member_tag shortcut coverage
This commit is contained in:
parent
251df4b193
commit
a126f8e0b1
3 changed files with 52 additions and 0 deletions
11
tests/test_api/test_methods/test_set_chat_member_tag.py
Normal file
11
tests/test_api/test_methods/test_set_chat_member_tag.py
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
from aiogram.methods import SetChatMemberTag
|
||||
from tests.mocked_bot import MockedBot
|
||||
|
||||
|
||||
class TestSetChatMemberTag:
|
||||
async def test_bot_method(self, bot: MockedBot):
|
||||
prepare_result = bot.add_result_for(SetChatMemberTag, ok=True, result=True)
|
||||
|
||||
response: bool = await bot.set_chat_member_tag(chat_id=-42, user_id=42, tag="test")
|
||||
bot.get_request()
|
||||
assert response == prepare_result.result
|
||||
|
|
@ -115,6 +115,14 @@ class TestChat:
|
|||
method = chat.set_administrator_custom_title(user_id=1, custom_title="test")
|
||||
assert method.chat_id == chat.id
|
||||
|
||||
def test_set_member_tag(self):
|
||||
chat = Chat(id=-42, type="supergroup")
|
||||
|
||||
method = chat.set_member_tag(user_id=42, tag="test")
|
||||
assert method.chat_id == chat.id
|
||||
assert method.user_id == 42
|
||||
assert method.tag == "test"
|
||||
|
||||
def test_set_permissions(self):
|
||||
chat = Chat(id=-42, type="supergroup")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue