Re-generate bot class, remove deprecated methods

This commit is contained in:
Alex Root Junior 2022-11-21 00:45:44 +02:00
parent a86298ea7d
commit 9557db424a
No known key found for this signature in database
GPG key ID: 074C1D455EBEA4AC
12 changed files with 2691 additions and 3027 deletions

View file

@ -1,24 +0,0 @@
import pytest
from aiogram.methods import GetChatMembersCount, Request
from tests.mocked_bot import MockedBot
pytestmark = pytest.mark.asyncio
class TestGetChatMembersCount:
async def test_method(self, bot: MockedBot):
prepare_result = bot.add_result_for(GetChatMembersCount, ok=True, result=42)
response: int = await GetChatMembersCount(chat_id=-42)
request: Request = bot.get_request()
assert request.method == "getChatMembersCount"
assert response == prepare_result.result
async def test_bot_method(self, bot: MockedBot):
prepare_result = bot.add_result_for(GetChatMembersCount, ok=True, result=42)
response: int = await bot.get_chat_members_count(chat_id=-42)
request: Request = bot.get_request()
assert request.method == "getChatMembersCount"
assert response == prepare_result.result

View file

@ -1,24 +0,0 @@
import pytest
from aiogram.methods import KickChatMember, Request
from tests.mocked_bot import MockedBot
pytestmark = pytest.mark.asyncio
class TestKickChatMember:
async def test_method(self, bot: MockedBot):
prepare_result = bot.add_result_for(KickChatMember, ok=True, result=True)
response: bool = await KickChatMember(chat_id=-42, user_id=42)
request: Request = bot.get_request()
assert request.method == "kickChatMember"
assert response == prepare_result.result
async def test_bot_method(self, bot: MockedBot):
prepare_result = bot.add_result_for(KickChatMember, ok=True, result=True)
response: bool = await bot.kick_chat_member(chat_id=-42, user_id=42)
request: Request = bot.get_request()
assert request.method == "kickChatMember"
assert response == prepare_result.result