Fixing tests and content types for Telegram Bot API 7.2

This commit is contained in:
RoLO0u 2024-04-07 17:05:51 +03:00
parent 27f0631bcf
commit 8aabfe0093
6 changed files with 56 additions and 5 deletions

View file

@ -1,3 +1,4 @@
from aiogram.enums import StickerFormat
from aiogram.methods import AddStickerToSet
from aiogram.types import InputSticker
from tests.mocked_bot import MockedBot
@ -10,7 +11,7 @@ class TestAddStickerToSet:
response: bool = await bot.add_sticker_to_set(
user_id=42,
name="test stickers pack",
sticker=InputSticker(sticker="file id", emoji_list=[":)"]),
sticker=InputSticker(sticker="file id", format=StickerFormat.STATIC, emoji_list=[":)"]),
)
request = bot.get_request()
assert response == prepare_result.result

View file

@ -13,8 +13,8 @@ class TestCreateNewStickerSet:
name="name",
title="title",
stickers=[
InputSticker(sticker="file id", emoji_list=[":)"]),
InputSticker(sticker=FSInputFile("file.png"), emoji_list=["=("]),
InputSticker(sticker="file id", format=StickerFormat.STATIC, emoji_list=[":)"]),
InputSticker(sticker=FSInputFile("file.png"), format=StickerFormat.STATIC, emoji_list=["=("]),
],
sticker_format=StickerFormat.STATIC,
)

View file

@ -1,3 +1,4 @@
from aiogram.enums import StickerFormat
from aiogram.methods import Request, SetStickerSetThumbnail
from tests.mocked_bot import MockedBot
@ -6,6 +7,6 @@ class TestSetStickerSetThumbnail:
async def test_bot_method(self, bot: MockedBot):
prepare_result = bot.add_result_for(SetStickerSetThumbnail, ok=True, result=None)
response: bool = await bot.set_sticker_set_thumbnail(name="test", user_id=42)
response: bool = await bot.set_sticker_set_thumbnail(name="test", format=StickerFormat.STATIC, user_id=42)
request = bot.get_request()
assert response == prepare_result.result