Fixing tests and content types for Telegram Bot API 7.2 update (#1453)

* Fixing tests and content types for Telegram Bot API 7.2

* Adding changelog for 1453 PR
This commit is contained in:
RoLOQ 2024-04-08 01:05:03 +03:00 committed by GitHub
parent 27f0631bcf
commit c96a4fceca
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 57 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