mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-08 17:13:56 +00:00
Add restrictChatMember test
This commit is contained in:
parent
28484d9352
commit
3548febeaf
1 changed files with 18 additions and 0 deletions
|
|
@ -307,3 +307,21 @@ async def test_unban_chat_member(bot: Bot, event_loop):
|
||||||
result = await bot.unban_chat_member(chat_id=chat.id, user_id=user.id)
|
result = await bot.unban_chat_member(chat_id=chat.id, user_id=user.id)
|
||||||
assert isinstance(result, bool)
|
assert isinstance(result, bool)
|
||||||
assert result is True
|
assert result is True
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.asyncio
|
||||||
|
async def test_restrict_chat_member(bot: Bot, event_loop):
|
||||||
|
""" restrictChatMember method test """
|
||||||
|
from .types.dataset import USER, CHAT
|
||||||
|
user = types.User(**USER)
|
||||||
|
chat = types.Chat(**CHAT)
|
||||||
|
|
||||||
|
async with FakeTelegram(message_dict=True, loop=event_loop):
|
||||||
|
result = await bot.restrict_chat_member(chat_id=chat.id, user_id=user.id,
|
||||||
|
can_add_web_page_previews=False,
|
||||||
|
can_send_media_messages=False,
|
||||||
|
can_send_messages=False,
|
||||||
|
can_send_other_messages=False,
|
||||||
|
until_date=123)
|
||||||
|
assert isinstance(result, bool)
|
||||||
|
assert result is True
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue