mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
* Add set_chat_member_tag shortcut coverage * Add set_member_tag shortcut tests and align decoration expectations * Fix follow-up test coverage for sender_tag and can_edit_tag * Add changelog fragment for PR 1781 * Align changelog with base PR #1780 * Expand 1780 changelog to cover base and follow-up scope * Treat sender_tag as metadata, not message content type --------- Co-authored-by: Latand <latand@users.noreply.github.com> Co-authored-by: Codex Agent <codex@openclaw.local>
This commit is contained in:
parent
251df4b193
commit
ebfab22d64
13 changed files with 202 additions and 8 deletions
|
|
@ -6,6 +6,11 @@ class TestPromoteChatMember:
|
|||
async def test_bot_method(self, bot: MockedBot):
|
||||
prepare_result = bot.add_result_for(PromoteChatMember, ok=True, result=True)
|
||||
|
||||
response: bool = await bot.promote_chat_member(chat_id=-42, user_id=42)
|
||||
bot.get_request()
|
||||
response: bool = await bot.promote_chat_member(
|
||||
chat_id=-42,
|
||||
user_id=42,
|
||||
can_manage_tags=True,
|
||||
)
|
||||
request = bot.get_request()
|
||||
assert request.can_manage_tags is True
|
||||
assert response == prepare_result.result
|
||||
|
|
|
|||
14
tests/test_api/test_methods/test_set_chat_member_tag.py
Normal file
14
tests/test_api/test_methods/test_set_chat_member_tag.py
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
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")
|
||||
request = bot.get_request()
|
||||
assert request.chat_id == -42
|
||||
assert request.user_id == 42
|
||||
assert request.tag == "test"
|
||||
assert response == prepare_result.result
|
||||
Loading…
Add table
Add a link
Reference in a new issue