Added full support of Bot API 6.4 (#1088)

* Remove warnings about pytest asyncio mode

* Update Bot API to 6.4

* Bump version

* Added changelog

* Update translations
This commit is contained in:
Alex Root Junior 2022-12-30 22:44:25 +02:00 committed by GitHub
parent b93b75804c
commit 730485e43a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
239 changed files with 2522 additions and 892 deletions

View file

@ -1,10 +1,6 @@
import pytest
from aiogram.methods import AddStickerToSet, Request
from tests.mocked_bot import MockedBot
pytestmark = pytest.mark.asyncio
class TestAddStickerToSet:
async def test_method(self, bot: MockedBot):

View file

@ -1,10 +1,6 @@
import pytest
from aiogram.methods import AnswerCallbackQuery, Request
from tests.mocked_bot import MockedBot
pytestmark = pytest.mark.asyncio
class TestAnswerCallbackQuery:
async def test_method(self, bot: MockedBot):

View file

@ -1,12 +1,8 @@
import pytest
from aiogram import Bot
from aiogram.methods import AnswerInlineQuery, Request
from aiogram.types import InlineQueryResult, InlineQueryResultPhoto, InputTextMessageContent
from tests.mocked_bot import MockedBot
pytestmark = pytest.mark.asyncio
class TestAnswerInlineQuery:
async def test_method(self, bot: MockedBot):

View file

@ -1,10 +1,6 @@
import pytest
from aiogram.methods import AnswerPreCheckoutQuery, Request
from tests.mocked_bot import MockedBot
pytestmark = pytest.mark.asyncio
class TestAnswerPreCheckoutQuery:
async def test_method(self, bot: MockedBot):

View file

@ -1,10 +1,6 @@
import pytest
from aiogram.methods import AnswerShippingQuery, Request
from tests.mocked_bot import MockedBot
pytestmark = pytest.mark.asyncio
class TestAnswerShippingQuery:
async def test_method(self, bot: MockedBot):

View file

@ -1,12 +1,9 @@
import pytest
from aiogram.methods import AnswerWebAppQuery, Request
from aiogram.types import InlineQueryResult, SentWebAppMessage
from tests.mocked_bot import MockedBot
class TestAnswerWebAppQuery:
@pytest.mark.asyncio
async def test_method(self, bot: MockedBot):
prepare_result = bot.add_result_for(AnswerWebAppQuery, ok=True, result=SentWebAppMessage())
@ -19,7 +16,6 @@ class TestAnswerWebAppQuery:
# assert request.data == {}
assert response == prepare_result.result
@pytest.mark.asyncio
async def test_bot_method(self, bot: MockedBot):
prepare_result = bot.add_result_for(AnswerWebAppQuery, ok=True, result=SentWebAppMessage())

View file

@ -1,11 +1,8 @@
import pytest
from aiogram.methods import ApproveChatJoinRequest, Request
from tests.mocked_bot import MockedBot
class TestApproveChatJoinRequest:
@pytest.mark.asyncio
async def test_method(self, bot: MockedBot):
prepare_result = bot.add_result_for(ApproveChatJoinRequest, ok=True, result=True)
@ -17,7 +14,6 @@ class TestApproveChatJoinRequest:
assert request.method == "approveChatJoinRequest"
assert response == prepare_result.result
@pytest.mark.asyncio
async def test_bot_method(self, bot: MockedBot):
prepare_result = bot.add_result_for(ApproveChatJoinRequest, ok=True, result=None)

View file

@ -1,10 +1,6 @@
import pytest
from aiogram.methods import BanChatMember, Request
from tests.mocked_bot import MockedBot
pytestmark = pytest.mark.asyncio
class TestKickChatMember:
async def test_method(self, bot: MockedBot):

View file

@ -1,11 +1,8 @@
import pytest
from aiogram.methods import BanChatSenderChat, Request
from tests.mocked_bot import MockedBot
class TestBanChatSenderChat:
@pytest.mark.asyncio
async def test_method(self, bot: MockedBot):
prepare_result = bot.add_result_for(BanChatSenderChat, ok=True, result=True)
@ -18,7 +15,6 @@ class TestBanChatSenderChat:
# assert request.data == {}
assert response == prepare_result.result
@pytest.mark.asyncio
async def test_bot_method(self, bot: MockedBot):
prepare_result = bot.add_result_for(BanChatSenderChat, ok=True, result=True)

View file

@ -6,8 +6,6 @@ from aiogram import Bot
from aiogram.methods.base import prepare_parse_mode
from tests.mocked_bot import MockedBot
pytestmark = pytest.mark.asyncio
class TestPrepareFile:
# TODO: Add tests

View file

@ -1,10 +1,6 @@
import pytest
from aiogram.methods import Close, Request
from tests.mocked_bot import MockedBot
pytestmark = pytest.mark.asyncio
class TestClose:
async def test_method(self, bot: MockedBot):

View file

@ -1,11 +1,8 @@
import pytest
from aiogram.methods import CloseForumTopic, Request
from tests.mocked_bot import MockedBot
class TestCloseForumTopic:
@pytest.mark.asyncio
async def test_method(self, bot: MockedBot):
prepare_result = bot.add_result_for(CloseForumTopic, ok=True, result=True)
@ -18,7 +15,6 @@ class TestCloseForumTopic:
# assert request.data == {}
assert response == prepare_result.result
@pytest.mark.asyncio
async def test_bot_method(self, bot: MockedBot):
prepare_result = bot.add_result_for(CloseForumTopic, ok=True, result=True)

View file

@ -0,0 +1,20 @@
from aiogram.methods import CloseGeneralForumTopic, Request
from tests.mocked_bot import MockedBot
class TestCloseGeneralForumTopic:
async def test_method(self, bot: MockedBot):
prepare_result = bot.add_result_for(CloseGeneralForumTopic, ok=True, result=True)
response: bool = await bot(CloseGeneralForumTopic(chat_id=42))
request: Request = bot.get_request()
assert request.method == "closeGeneralForumTopic"
assert response == prepare_result.result
async def test_bot_method(self, bot: MockedBot):
prepare_result = bot.add_result_for(CloseGeneralForumTopic, ok=True, result=True)
response: bool = await bot.close_general_forum_topic(chat_id=42)
request: Request = bot.get_request()
assert request.method == "closeGeneralForumTopic"
assert response == prepare_result.result

View file

@ -1,11 +1,7 @@
import pytest
from aiogram.methods import CopyMessage, Request
from aiogram.types import MessageId
from tests.mocked_bot import MockedBot
pytestmark = pytest.mark.asyncio
class TestCopyMessage:
async def test_method(self, bot: MockedBot):

View file

@ -1,11 +1,7 @@
import pytest
from aiogram.methods import CreateChatInviteLink, Request
from aiogram.types import ChatInviteLink, User
from tests.mocked_bot import MockedBot
pytestmark = pytest.mark.asyncio
class TestCreateChatInviteLink:
async def test_method(self, bot: MockedBot):

View file

@ -1,12 +1,9 @@
import pytest
from aiogram.methods import CreateForumTopic, Request
from aiogram.types import ForumTopic
from tests.mocked_bot import MockedBot
class TestCreateForumTopic:
@pytest.mark.asyncio
async def test_method(self, bot: MockedBot):
prepare_result = bot.add_result_for(
CreateForumTopic,
@ -23,7 +20,6 @@ class TestCreateForumTopic:
# assert request.data == {}
assert response == prepare_result.result
@pytest.mark.asyncio
async def test_bot_method(self, bot: MockedBot):
prepare_result = bot.add_result_for(
CreateForumTopic,

View file

@ -1,12 +1,9 @@
import pytest
from aiogram.methods import CreateInvoiceLink, Request
from aiogram.types import LabeledPrice
from tests.mocked_bot import MockedBot
class TestCreateInvoiceLink:
@pytest.mark.asyncio
async def test_method(self, bot: MockedBot):
prepare_result = bot.add_result_for(
CreateInvoiceLink, ok=True, result="https://t.me/invoice/example"
@ -24,7 +21,6 @@ class TestCreateInvoiceLink:
assert request.method == "createInvoiceLink"
assert response == prepare_result.result
@pytest.mark.asyncio
async def test_bot_method(self, bot: MockedBot):
prepare_result = bot.add_result_for(
CreateInvoiceLink, ok=True, result="https://t.me/invoice/example"

View file

@ -1,10 +1,6 @@
import pytest
from aiogram.methods import CreateNewStickerSet, Request
from tests.mocked_bot import MockedBot
pytestmark = pytest.mark.asyncio
class TestCreateNewStickerSet:
async def test_method(self, bot: MockedBot):

View file

@ -1,11 +1,8 @@
import pytest
from aiogram.methods import DeclineChatJoinRequest, Request
from tests.mocked_bot import MockedBot
class TestDeclineChatJoinRequest:
@pytest.mark.asyncio
async def test_method(self, bot: MockedBot):
prepare_result = bot.add_result_for(DeclineChatJoinRequest, ok=True, result=True)
@ -17,7 +14,6 @@ class TestDeclineChatJoinRequest:
assert request.method == "declineChatJoinRequest"
assert response == prepare_result.result
@pytest.mark.asyncio
async def test_bot_method(self, bot: MockedBot):
prepare_result = bot.add_result_for(DeclineChatJoinRequest, ok=True, result=True)

View file

@ -1,10 +1,6 @@
import pytest
from aiogram.methods import DeleteChatPhoto, Request
from tests.mocked_bot import MockedBot
pytestmark = pytest.mark.asyncio
class TestDeleteChatPhoto:
async def test_method(self, bot: MockedBot):

View file

@ -1,10 +1,6 @@
import pytest
from aiogram.methods import DeleteChatStickerSet, Request
from tests.mocked_bot import MockedBot
pytestmark = pytest.mark.asyncio
class TestDeleteChatStickerSet:
async def test_method(self, bot: MockedBot):

View file

@ -1,11 +1,8 @@
import pytest
from aiogram.methods import DeleteForumTopic, Request
from tests.mocked_bot import MockedBot
class TestDeleteForumTopic:
@pytest.mark.asyncio
async def test_method(self, bot: MockedBot):
prepare_result = bot.add_result_for(DeleteForumTopic, ok=True, result=True)
@ -18,7 +15,6 @@ class TestDeleteForumTopic:
# assert request.data == {}
assert response == prepare_result.result
@pytest.mark.asyncio
async def test_bot_method(self, bot: MockedBot):
prepare_result = bot.add_result_for(DeleteForumTopic, ok=True, result=True)

View file

@ -1,10 +1,6 @@
import pytest
from aiogram.methods import DeleteMessage, Request
from tests.mocked_bot import MockedBot
pytestmark = pytest.mark.asyncio
class TestDeleteMessage:
async def test_method(self, bot: MockedBot):

View file

@ -1,10 +1,6 @@
import pytest
from aiogram.methods import DeleteMyCommands, Request
from tests.mocked_bot import MockedBot
pytestmark = pytest.mark.asyncio
class TestKickChatMember:
async def test_method(self, bot: MockedBot):

View file

@ -1,10 +1,6 @@
import pytest
from aiogram.methods import DeleteStickerFromSet, Request
from tests.mocked_bot import MockedBot
pytestmark = pytest.mark.asyncio
class TestDeleteStickerFromSet:
async def test_method(self, bot: MockedBot):

View file

@ -1,10 +1,6 @@
import pytest
from aiogram.methods import DeleteWebhook, Request
from tests.mocked_bot import MockedBot
pytestmark = pytest.mark.asyncio
class TestDeleteWebhook:
async def test_method(self, bot: MockedBot):

View file

@ -1,11 +1,7 @@
import pytest
from aiogram.methods import EditChatInviteLink, Request
from aiogram.types import ChatInviteLink, User
from tests.mocked_bot import MockedBot
pytestmark = pytest.mark.asyncio
class TestEditChatInviteLink:
async def test_method(self, bot: MockedBot):

View file

@ -1,11 +1,8 @@
import pytest
from aiogram.methods import EditForumTopic, Request
from tests.mocked_bot import MockedBot
class TestEditForumTopic:
@pytest.mark.asyncio
async def test_method(self, bot: MockedBot):
prepare_result = bot.add_result_for(EditForumTopic, ok=True, result=True)
@ -21,7 +18,6 @@ class TestEditForumTopic:
# assert request.data == {}
assert response == prepare_result.result
@pytest.mark.asyncio
async def test_bot_method(self, bot: MockedBot):
prepare_result = bot.add_result_for(EditForumTopic, ok=True, result=True)

View file

@ -0,0 +1,20 @@
from aiogram.methods import EditGeneralForumTopic, Request
from tests.mocked_bot import MockedBot
class TestCloseGeneralForumTopic:
async def test_method(self, bot: MockedBot):
prepare_result = bot.add_result_for(EditGeneralForumTopic, ok=True, result=True)
response: bool = await bot(EditGeneralForumTopic(chat_id=42, name="Test"))
request: Request = bot.get_request()
assert request.method == "editGeneralForumTopic"
assert response == prepare_result.result
async def test_bot_method(self, bot: MockedBot):
prepare_result = bot.add_result_for(EditGeneralForumTopic, ok=True, result=True)
response: bool = await bot.edit_general_forum_topic(chat_id=42, name="Test")
request: Request = bot.get_request()
assert request.method == "editGeneralForumTopic"
assert response == prepare_result.result

View file

@ -1,14 +1,10 @@
import datetime
from typing import Union
import pytest
from aiogram.methods import EditMessageCaption, Request
from aiogram.types import Chat, Message
from tests.mocked_bot import MockedBot
pytestmark = pytest.mark.asyncio
class TestEditMessageCaption:
async def test_method(self, bot: MockedBot):

View file

@ -1,13 +1,9 @@
from typing import Union
import pytest
from aiogram.methods import EditMessageLiveLocation, Request
from aiogram.types import Message
from tests.mocked_bot import MockedBot
pytestmark = pytest.mark.asyncio
class TestEditMessageLiveLocation:
async def test_method(self, bot: MockedBot):

View file

@ -1,13 +1,9 @@
from typing import Union
import pytest
from aiogram.methods import EditMessageMedia, Request
from aiogram.types import BufferedInputFile, InputMediaPhoto, Message
from tests.mocked_bot import MockedBot
pytestmark = pytest.mark.asyncio
class TestEditMessageMedia:
async def test_method(self, bot: MockedBot):

View file

@ -1,13 +1,9 @@
from typing import Union
import pytest
from aiogram.methods import EditMessageReplyMarkup, Request
from aiogram.types import InlineKeyboardButton, InlineKeyboardMarkup, Message
from tests.mocked_bot import MockedBot
pytestmark = pytest.mark.asyncio
class TestEditMessageReplyMarkup:
async def test_method(self, bot: MockedBot):

View file

@ -1,13 +1,9 @@
from typing import Union
import pytest
from aiogram.methods import EditMessageText, Request
from aiogram.types import Message
from tests.mocked_bot import MockedBot
pytestmark = pytest.mark.asyncio
class TestEditMessageText:
async def test_method(self, bot: MockedBot):

View file

@ -1,10 +1,6 @@
import pytest
from aiogram.methods import ExportChatInviteLink, Request
from tests.mocked_bot import MockedBot
pytestmark = pytest.mark.asyncio
class TestExportChatInviteLink:
async def test_method(self, bot: MockedBot):

View file

@ -1,13 +1,9 @@
import datetime
import pytest
from aiogram.methods import ForwardMessage, Request
from aiogram.types import Chat, Message
from tests.mocked_bot import MockedBot
pytestmark = pytest.mark.asyncio
class TestForwardMessage:
async def test_method(self, bot: MockedBot):

View file

@ -1,11 +1,7 @@
import pytest
from aiogram.methods import GetChat, Request
from aiogram.types import Chat
from tests.mocked_bot import MockedBot
pytestmark = pytest.mark.asyncio
class TestGetChat:
async def test_method(self, bot: MockedBot):

View file

@ -1,13 +1,9 @@
from typing import List
import pytest
from aiogram.methods import GetChatAdministrators, Request
from aiogram.types import ChatMember, ChatMemberOwner, User
from tests.mocked_bot import MockedBot
pytestmark = pytest.mark.asyncio
class TestGetChatAdministrators:
async def test_method(self, bot: MockedBot):

View file

@ -1,11 +1,7 @@
import pytest
from aiogram.methods import GetChatMember, Request
from aiogram.types import ChatMember, ChatMemberOwner, User
from tests.mocked_bot import MockedBot
pytestmark = pytest.mark.asyncio
class TestGetChatMember:
async def test_method(self, bot: MockedBot):

View file

@ -1,10 +1,6 @@
import pytest
from aiogram.methods import GetChatMemberCount, Request
from tests.mocked_bot import MockedBot
pytestmark = pytest.mark.asyncio
class TestGetChatMembersCount:
async def test_method(self, bot: MockedBot):

View file

@ -1,12 +1,9 @@
import pytest
from aiogram.methods import GetChatMenuButton, Request
from aiogram.types import MenuButton, MenuButtonDefault
from tests.mocked_bot import MockedBot
class TestGetChatMenuButton:
@pytest.mark.asyncio
async def test_method(self, bot: MockedBot):
prepare_result = bot.add_result_for(GetChatMenuButton, ok=True, result=MenuButtonDefault())
@ -16,7 +13,6 @@ class TestGetChatMenuButton:
# assert request.data == {}
assert response == prepare_result.result
@pytest.mark.asyncio
async def test_bot_method(self, bot: MockedBot):
prepare_result = bot.add_result_for(GetChatMenuButton, ok=True, result=MenuButtonDefault())

View file

@ -1,14 +1,11 @@
from typing import List
import pytest
from aiogram.methods import GetCustomEmojiStickers, Request
from aiogram.types import Sticker
from tests.mocked_bot import MockedBot
class TestGetCustomEmojiStickers:
@pytest.mark.asyncio
async def test_method(self, bot: MockedBot):
prepare_result = bot.add_result_for(
GetCustomEmojiStickers,
@ -35,7 +32,6 @@ class TestGetCustomEmojiStickers:
# assert request.data == {}
assert response == prepare_result.result
@pytest.mark.asyncio
async def test_bot_method(self, bot: MockedBot):
prepare_result = bot.add_result_for(
GetCustomEmojiStickers,

View file

@ -1,11 +1,7 @@
import pytest
from aiogram.methods import GetFile, Request
from aiogram.types import File
from tests.mocked_bot import MockedBot
pytestmark = pytest.mark.asyncio
class TestGetFile:
async def test_method(self, bot: MockedBot):

View file

@ -1,14 +1,11 @@
from typing import List
import pytest
from aiogram.methods import GetForumTopicIconStickers, Request
from aiogram.types import Sticker
from tests.mocked_bot import MockedBot
class TestGetForumTopicIconStickers:
@pytest.mark.asyncio
async def test_method(self, bot: MockedBot):
prepare_result = bot.add_result_for(GetForumTopicIconStickers, ok=True, result=[])
@ -18,7 +15,6 @@ class TestGetForumTopicIconStickers:
# assert request.data == {}
assert response == prepare_result.result
@pytest.mark.asyncio
async def test_bot_method(self, bot: MockedBot):
prepare_result = bot.add_result_for(GetForumTopicIconStickers, ok=True, result=[])

View file

@ -1,13 +1,9 @@
from typing import List
import pytest
from aiogram.methods import GetGameHighScores, Request
from aiogram.types import GameHighScore, User
from tests.mocked_bot import MockedBot
pytestmark = pytest.mark.asyncio
class TestGetGameHighScores:
async def test_method(self, bot: MockedBot):

View file

@ -1,11 +1,7 @@
import pytest
from aiogram.methods import GetMe, Request
from aiogram.types import User
from tests.mocked_bot import MockedBot
pytestmark = pytest.mark.asyncio
class TestGetMe:
async def test_method(self, bot: MockedBot):

View file

@ -1,13 +1,9 @@
from typing import List
import pytest
from aiogram.methods import GetMyCommands, Request
from aiogram.types import BotCommand
from tests.mocked_bot import MockedBot
pytestmark = pytest.mark.asyncio
class TestGetMyCommands:
async def test_method(self, bot: MockedBot):

View file

@ -1,12 +1,9 @@
import pytest
from aiogram.methods import GetMyDefaultAdministratorRights, Request
from aiogram.types import ChatAdministratorRights
from tests.mocked_bot import MockedBot
class TestGetMyDefaultAdministratorRights:
@pytest.mark.asyncio
async def test_method(self, bot: MockedBot):
prepare_result = bot.add_result_for(
GetMyDefaultAdministratorRights,
@ -29,7 +26,6 @@ class TestGetMyDefaultAdministratorRights:
# assert request.data == {}
assert response == prepare_result.result
@pytest.mark.asyncio
async def test_bot_method(self, bot: MockedBot):
prepare_result = bot.add_result_for(
GetMyDefaultAdministratorRights,

View file

@ -1,11 +1,7 @@
import pytest
from aiogram.methods import GetStickerSet, Request
from aiogram.types import Sticker, StickerSet
from tests.mocked_bot import MockedBot
pytestmark = pytest.mark.asyncio
class TestGetStickerSet:
async def test_method(self, bot: MockedBot):

View file

@ -1,13 +1,9 @@
from typing import List
import pytest
from aiogram.methods import GetUpdates, Request
from aiogram.types import Update
from tests.mocked_bot import MockedBot
pytestmark = pytest.mark.asyncio
class TestGetUpdates:
async def test_method(self, bot: MockedBot):

View file

@ -1,11 +1,7 @@
import pytest
from aiogram.methods import GetUserProfilePhotos, Request
from aiogram.types import PhotoSize, UserProfilePhotos
from tests.mocked_bot import MockedBot
pytestmark = pytest.mark.asyncio
class TestGetUserProfilePhotos:
async def test_method(self, bot: MockedBot):

View file

@ -1,11 +1,7 @@
import pytest
from aiogram.methods import GetWebhookInfo, Request
from aiogram.types import WebhookInfo
from tests.mocked_bot import MockedBot
pytestmark = pytest.mark.asyncio
class TestGetWebhookInfo:
async def test_method(self, bot: MockedBot):

View file

@ -0,0 +1,20 @@
from aiogram.methods import HideGeneralForumTopic, Request
from tests.mocked_bot import MockedBot
class TestHideGeneralForumTopic:
async def test_method(self, bot: MockedBot):
prepare_result = bot.add_result_for(HideGeneralForumTopic, ok=True, result=True)
response: bool = await bot(HideGeneralForumTopic(chat_id=42))
request: Request = bot.get_request()
assert request.method == "hideGeneralForumTopic"
assert response == prepare_result.result
async def test_bot_method(self, bot: MockedBot):
prepare_result = bot.add_result_for(HideGeneralForumTopic, ok=True, result=True)
response: bool = await bot.hide_general_forum_topic(chat_id=42)
request: Request = bot.get_request()
assert request.method == "hideGeneralForumTopic"
assert response == prepare_result.result

View file

@ -1,10 +1,6 @@
import pytest
from aiogram.methods import LeaveChat, Request
from tests.mocked_bot import MockedBot
pytestmark = pytest.mark.asyncio
class TestLeaveChat:
async def test_method(self, bot: MockedBot):

View file

@ -1,10 +1,6 @@
import pytest
from aiogram.methods import LogOut, Request
from tests.mocked_bot import MockedBot
pytestmark = pytest.mark.asyncio
class TestLogOut:
async def test_method(self, bot: MockedBot):

View file

@ -1,10 +1,6 @@
import pytest
from aiogram.methods import PinChatMessage, Request
from tests.mocked_bot import MockedBot
pytestmark = pytest.mark.asyncio
class TestPinChatMessage:
async def test_method(self, bot: MockedBot):

View file

@ -1,10 +1,6 @@
import pytest
from aiogram.methods import PromoteChatMember, Request
from tests.mocked_bot import MockedBot
pytestmark = pytest.mark.asyncio
class TestPromoteChatMember:
async def test_method(self, bot: MockedBot):

View file

@ -1,11 +1,8 @@
import pytest
from aiogram.methods import ReopenForumTopic, Request
from tests.mocked_bot import MockedBot
class TestReopenForumTopic:
@pytest.mark.asyncio
async def test_method(self, bot: MockedBot):
prepare_result = bot.add_result_for(ReopenForumTopic, ok=True, result=None)
@ -18,7 +15,6 @@ class TestReopenForumTopic:
# assert request.data == {}
assert response == prepare_result.result
@pytest.mark.asyncio
async def test_bot_method(self, bot: MockedBot):
prepare_result = bot.add_result_for(ReopenForumTopic, ok=True, result=None)

View file

@ -0,0 +1,20 @@
from aiogram.methods import ReopenGeneralForumTopic, Request
from tests.mocked_bot import MockedBot
class TestReopenGeneralForumTopic:
async def test_method(self, bot: MockedBot):
prepare_result = bot.add_result_for(ReopenGeneralForumTopic, ok=True, result=True)
response: bool = await bot(ReopenGeneralForumTopic(chat_id=42))
request: Request = bot.get_request()
assert request.method == "reopenGeneralForumTopic"
assert response == prepare_result.result
async def test_bot_method(self, bot: MockedBot):
prepare_result = bot.add_result_for(ReopenGeneralForumTopic, ok=True, result=True)
response: bool = await bot.reopen_general_forum_topic(chat_id=42)
request: Request = bot.get_request()
assert request.method == "reopenGeneralForumTopic"
assert response == prepare_result.result

View file

@ -1,11 +1,7 @@
import pytest
from aiogram.methods import Request, RestrictChatMember
from aiogram.types import ChatPermissions
from tests.mocked_bot import MockedBot
pytestmark = pytest.mark.asyncio
class TestRestrictChatMember:
async def test_method(self, bot: MockedBot):

View file

@ -1,11 +1,7 @@
import pytest
from aiogram.methods import Request, RevokeChatInviteLink
from aiogram.types import ChatInviteLink, User
from tests.mocked_bot import MockedBot
pytestmark = pytest.mark.asyncio
class TestRevokeChatInviteLink:
async def test_method(self, bot: MockedBot):

View file

@ -1,13 +1,9 @@
import datetime
import pytest
from aiogram.methods import Request, SendAnimation
from aiogram.types import Animation, Chat, Message
from tests.mocked_bot import MockedBot
pytestmark = pytest.mark.asyncio
class TestSendAnimation:
async def test_method(self, bot: MockedBot):

View file

@ -1,13 +1,9 @@
import datetime
import pytest
from aiogram.methods import Request, SendAudio
from aiogram.types import Audio, Chat, Message
from tests.mocked_bot import MockedBot
pytestmark = pytest.mark.asyncio
class TestSendAudio:
async def test_method(self, bot: MockedBot):

View file

@ -1,11 +1,7 @@
import pytest
from aiogram.enums import ChatAction
from aiogram.methods import Request, SendChatAction
from tests.mocked_bot import MockedBot
pytestmark = pytest.mark.asyncio
class TestSendChatAction:
async def test_method(self, bot: MockedBot):

View file

@ -1,13 +1,9 @@
import datetime
import pytest
from aiogram.methods import Request, SendContact
from aiogram.types import Chat, Contact, Message
from tests.mocked_bot import MockedBot
pytestmark = pytest.mark.asyncio
class TestSendContact:
async def test_method(self, bot: MockedBot):

View file

@ -1,11 +1,7 @@
import pytest
from aiogram.methods import Request, SendDice
from aiogram.types import Message
from tests.mocked_bot import MockedBot
pytestmark = pytest.mark.asyncio
class TestSendDice:
async def test_method(self, bot: MockedBot):

View file

@ -1,13 +1,9 @@
import datetime
import pytest
from aiogram.methods import Request, SendDocument
from aiogram.types import Chat, Document, Message
from tests.mocked_bot import MockedBot
pytestmark = pytest.mark.asyncio
class TestSendDocument:
async def test_method(self, bot: MockedBot):

View file

@ -1,13 +1,9 @@
import datetime
import pytest
from aiogram.methods import Request, SendGame
from aiogram.types import Chat, Game, Message, PhotoSize
from tests.mocked_bot import MockedBot
pytestmark = pytest.mark.asyncio
class TestSendGame:
async def test_method(self, bot: MockedBot):

View file

@ -1,13 +1,9 @@
import datetime
import pytest
from aiogram.methods import Request, SendInvoice
from aiogram.types import Chat, Invoice, LabeledPrice, Message
from tests.mocked_bot import MockedBot
pytestmark = pytest.mark.asyncio
class TestSendInvoice:
async def test_method(self, bot: MockedBot):

View file

@ -1,13 +1,9 @@
import datetime
import pytest
from aiogram.methods import Request, SendLocation
from aiogram.types import Chat, Location, Message
from tests.mocked_bot import MockedBot
pytestmark = pytest.mark.asyncio
class TestSendLocation:
async def test_method(self, bot: MockedBot):

View file

@ -1,8 +1,6 @@
import datetime
from typing import List
import pytest
from aiogram.methods import Request, SendMediaGroup
from aiogram.types import (
BufferedInputFile,
@ -15,8 +13,6 @@ from aiogram.types import (
)
from tests.mocked_bot import MockedBot
pytestmark = pytest.mark.asyncio
class TestSendMediaGroup:
async def test_method(self, bot: MockedBot):

View file

@ -1,13 +1,9 @@
import datetime
import pytest
from aiogram.methods import Request, SendMessage
from aiogram.types import Chat, ForceReply, Message
from tests.mocked_bot import MockedBot
pytestmark = pytest.mark.asyncio
class TestSendMessage:
async def test_method(self, bot: MockedBot):

View file

@ -1,13 +1,9 @@
import datetime
import pytest
from aiogram.methods import Request, SendPhoto
from aiogram.types import Chat, Message, PhotoSize
from tests.mocked_bot import MockedBot
pytestmark = pytest.mark.asyncio
class TestSendPhoto:
async def test_method(self, bot: MockedBot):

View file

@ -1,13 +1,9 @@
import datetime
import pytest
from aiogram.methods import Request, SendPoll
from aiogram.types import Chat, Message, Poll, PollOption
from tests.mocked_bot import MockedBot
pytestmark = pytest.mark.asyncio
class TestSendPoll:
async def test_method(self, bot: MockedBot):

View file

@ -1,13 +1,9 @@
import datetime
import pytest
from aiogram.methods import Request, SendSticker
from aiogram.types import Chat, Message, Sticker
from tests.mocked_bot import MockedBot
pytestmark = pytest.mark.asyncio
class TestSendSticker:
async def test_method(self, bot: MockedBot):

View file

@ -1,13 +1,9 @@
import datetime
import pytest
from aiogram.methods import Request, SendVenue
from aiogram.types import Chat, Location, Message, Venue
from tests.mocked_bot import MockedBot
pytestmark = pytest.mark.asyncio
class TestSendVenue:
async def test_method(self, bot: MockedBot):

View file

@ -1,13 +1,9 @@
import datetime
import pytest
from aiogram.methods import Request, SendVideo
from aiogram.types import Chat, Message, Video
from tests.mocked_bot import MockedBot
pytestmark = pytest.mark.asyncio
class TestSendVideo:
async def test_method(self, bot: MockedBot):

View file

@ -1,13 +1,9 @@
import datetime
import pytest
from aiogram.methods import Request, SendVideoNote
from aiogram.types import BufferedInputFile, Chat, Message, VideoNote
from tests.mocked_bot import MockedBot
pytestmark = pytest.mark.asyncio
class TestSendVideoNote:
async def test_method(self, bot: MockedBot):

View file

@ -1,13 +1,9 @@
import datetime
import pytest
from aiogram.methods import Request, SendVoice
from aiogram.types import Chat, Message, Voice
from tests.mocked_bot import MockedBot
pytestmark = pytest.mark.asyncio
class TestSendVoice:
async def test_method(self, bot: MockedBot):

View file

@ -1,10 +1,6 @@
import pytest
from aiogram.methods import Request, SetChatAdministratorCustomTitle
from tests.mocked_bot import MockedBot
pytestmark = pytest.mark.asyncio
class TestSetChatTitle:
async def test_method(self, bot: MockedBot):

View file

@ -1,10 +1,6 @@
import pytest
from aiogram.methods import Request, SetChatDescription
from tests.mocked_bot import MockedBot
pytestmark = pytest.mark.asyncio
class TestSetChatDescription:
async def test_method(self, bot: MockedBot):

View file

@ -1,11 +1,8 @@
import pytest
from aiogram.methods import Request, SetChatMenuButton
from tests.mocked_bot import MockedBot
class TestSetChatMenuButton:
@pytest.mark.asyncio
async def test_method(self, bot: MockedBot):
prepare_result = bot.add_result_for(SetChatMenuButton, ok=True, result=True)
@ -15,7 +12,6 @@ class TestSetChatMenuButton:
# assert request.data == {}
assert response == prepare_result.result
@pytest.mark.asyncio
async def test_bot_method(self, bot: MockedBot):
prepare_result = bot.add_result_for(SetChatMenuButton, ok=True, result=True)

View file

@ -1,11 +1,7 @@
import pytest
from aiogram.methods import Request, SetChatPermissions
from aiogram.types import ChatPermissions
from tests.mocked_bot import MockedBot
pytestmark = pytest.mark.asyncio
class TestSetChatPermissions:
async def test_method(self, bot: MockedBot):

View file

@ -1,11 +1,7 @@
import pytest
from aiogram.methods import Request, SetChatPhoto
from aiogram.types import BufferedInputFile
from tests.mocked_bot import MockedBot
pytestmark = pytest.mark.asyncio
class TestSetChatPhoto:
async def test_method(self, bot: MockedBot):

View file

@ -1,10 +1,6 @@
import pytest
from aiogram.methods import Request, SetChatStickerSet
from tests.mocked_bot import MockedBot
pytestmark = pytest.mark.asyncio
class TestSetChatStickerSet:
async def test_method(self, bot: MockedBot):

View file

@ -1,10 +1,6 @@
import pytest
from aiogram.methods import Request, SetChatTitle
from tests.mocked_bot import MockedBot
pytestmark = pytest.mark.asyncio
class TestSetChatTitle:
async def test_method(self, bot: MockedBot):

View file

@ -1,13 +1,9 @@
from typing import Union
import pytest
from aiogram.methods import Request, SetGameScore
from aiogram.types import Message
from tests.mocked_bot import MockedBot
pytestmark = pytest.mark.asyncio
class TestSetGameScore:
async def test_method(self, bot: MockedBot):

View file

@ -1,11 +1,7 @@
import pytest
from aiogram.methods import Request, SetMyCommands
from aiogram.types import BotCommand
from tests.mocked_bot import MockedBot
pytestmark = pytest.mark.asyncio
class TestSetMyCommands:
async def test_method(self, bot: MockedBot):

View file

@ -1,11 +1,8 @@
import pytest
from aiogram.methods import Request, SetMyDefaultAdministratorRights
from tests.mocked_bot import MockedBot
class TestSetMyDefaultAdministratorRights:
@pytest.mark.asyncio
async def test_method(self, bot: MockedBot):
prepare_result = bot.add_result_for(SetMyDefaultAdministratorRights, ok=True, result=True)
@ -15,7 +12,6 @@ class TestSetMyDefaultAdministratorRights:
# assert request.data == {}
assert response == prepare_result.result
@pytest.mark.asyncio
async def test_bot_method(self, bot: MockedBot):
prepare_result = bot.add_result_for(SetMyDefaultAdministratorRights, ok=True, result=True)

View file

@ -1,11 +1,7 @@
import pytest
from aiogram.methods import Request, SetPassportDataErrors
from aiogram.types import PassportElementError
from tests.mocked_bot import MockedBot
pytestmark = pytest.mark.asyncio
class TestSetPassportDataErrors:
async def test_method(self, bot: MockedBot):

View file

@ -1,10 +1,6 @@
import pytest
from aiogram.methods import Request, SetStickerPositionInSet
from tests.mocked_bot import MockedBot
pytestmark = pytest.mark.asyncio
class TestSetStickerPositionInSet:
async def test_method(self, bot: MockedBot):

View file

@ -1,10 +1,6 @@
import pytest
from aiogram.methods import Request, SetStickerSetThumb
from tests.mocked_bot import MockedBot
pytestmark = pytest.mark.asyncio
class TestSetStickerSetThumb:
async def test_method(self, bot: MockedBot):

View file

@ -1,10 +1,6 @@
import pytest
from aiogram.methods import Request, SetWebhook
from tests.mocked_bot import MockedBot
pytestmark = pytest.mark.asyncio
class TestSetWebhook:
async def test_method(self, bot: MockedBot):

View file

@ -1,13 +1,9 @@
from typing import Union
import pytest
from aiogram.methods import Request, StopMessageLiveLocation
from aiogram.types import Message
from tests.mocked_bot import MockedBot
pytestmark = pytest.mark.asyncio
class TestStopMessageLiveLocation:
async def test_method(self, bot: MockedBot):

View file

@ -1,11 +1,7 @@
import pytest
from aiogram.methods import Request, StopPoll
from aiogram.types import Poll, PollOption
from tests.mocked_bot import MockedBot
pytestmark = pytest.mark.asyncio
class TestStopPoll:
async def test_method(self, bot: MockedBot):

View file

@ -1,10 +1,6 @@
import pytest
from aiogram.methods import Request, UnbanChatMember
from tests.mocked_bot import MockedBot
pytestmark = pytest.mark.asyncio
class TestUnbanChatMember:
async def test_method(self, bot: MockedBot):

View file

@ -1,11 +1,8 @@
import pytest
from aiogram.methods import Request, UnbanChatSenderChat
from tests.mocked_bot import MockedBot
class TestUnbanChatSenderChat:
@pytest.mark.asyncio
async def test_method(self, bot: MockedBot):
prepare_result = bot.add_result_for(UnbanChatSenderChat, ok=True, result=True)
@ -18,7 +15,6 @@ class TestUnbanChatSenderChat:
# assert request.data == {}
assert response == prepare_result.result
@pytest.mark.asyncio
async def test_bot_method(self, bot: MockedBot):
prepare_result = bot.add_result_for(UnbanChatSenderChat, ok=True, result=True)

View file

@ -0,0 +1,20 @@
from aiogram.methods import Request, UnhideGeneralForumTopic
from tests.mocked_bot import MockedBot
class TestUnhideGeneralForumTopic:
async def test_method(self, bot: MockedBot):
prepare_result = bot.add_result_for(UnhideGeneralForumTopic, ok=True, result=True)
response: bool = await bot(UnhideGeneralForumTopic(chat_id=42))
request: Request = bot.get_request()
assert request.method == "unhideGeneralForumTopic"
assert response == prepare_result.result
async def test_bot_method(self, bot: MockedBot):
prepare_result = bot.add_result_for(UnhideGeneralForumTopic, ok=True, result=True)
response: bool = await bot.unhide_general_forum_topic(chat_id=42)
request: Request = bot.get_request()
assert request.method == "unhideGeneralForumTopic"
assert response == prepare_result.result

View file

@ -1,10 +1,6 @@
import pytest
from aiogram.methods import Request, UnpinAllChatMessages
from tests.mocked_bot import MockedBot
pytestmark = pytest.mark.asyncio
class TestUnpinAllChatMessages:
async def test_method(self, bot: MockedBot):

View file

@ -1,11 +1,8 @@
import pytest
from aiogram.methods import Request, UnpinAllForumTopicMessages
from tests.mocked_bot import MockedBot
class TestUnpinAllForumTopicMessages:
@pytest.mark.asyncio
async def test_method(self, bot: MockedBot):
prepare_result = bot.add_result_for(UnpinAllForumTopicMessages, ok=True, result=True)
@ -18,7 +15,6 @@ class TestUnpinAllForumTopicMessages:
# assert request.data == {}
assert response == prepare_result.result
@pytest.mark.asyncio
async def test_bot_method(self, bot: MockedBot):
prepare_result = bot.add_result_for(UnpinAllForumTopicMessages, ok=True, result=True)

Some files were not shown because too many files have changed in this diff Show more