Add exportChatInviteLink test

This commit is contained in:
Oleg Abramov 2018-04-04 18:47:32 +03:00
parent dd559da6f4
commit bd701c3768
2 changed files with 13 additions and 0 deletions

View file

@ -338,3 +338,14 @@ async def test_promote_chat_member(bot: Bot, event_loop):
can_promote_members=True, can_restrict_members=True)
assert isinstance(result, bool)
assert result is True
@pytest.mark.asyncio
async def test_export_chat_invite_link(bot: Bot, event_loop):
""" exportChatInviteLink method test """
from .types.dataset import CHAT, INVITE_LINK
chat = types.Chat(**CHAT)
async with FakeTelegram(message_dict=INVITE_LINK, loop=event_loop):
result = await bot.export_chat_invite_link(chat_id=chat.id)
assert result == INVITE_LINK

View file

@ -404,6 +404,8 @@ FILE = {
"file_path": "voice\/file_8"
}
INVITE_LINK = 'https://t.me/joinchat/AbCdEfjKILDADwdd123'
UPDATE = {
"update_id": 123456789,
"message": MESSAGE