mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-12 02:03:04 +00:00
Adding new code-generator (Butcher) (#1069)
* Re-generate types * Re-generate methods (only attributes) * Added enums * Base init generator * Added butcher configs * Fixed tests, bump butcher * Added changelog * Added enum docs * Added templates for docs index * Re-generate bot class, remove deprecated methods
This commit is contained in:
parent
c7779abc50
commit
d034c1ba9f
387 changed files with 32036 additions and 3144 deletions
|
|
@ -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
|
||||
|
|
@ -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
|
||||
Loading…
Add table
Add a link
Reference in a new issue