mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Revert re-generated tests
This commit is contained in:
parent
8a37958e82
commit
e5644248f9
4 changed files with 27 additions and 35 deletions
|
|
@ -1,22 +1,20 @@
|
|||
import pytest
|
||||
|
||||
from aiogram.api.methods import ApproveChatJoinRequest, Request
|
||||
from aiogram.methods import ApproveChatJoinRequest, Request
|
||||
from tests.mocked_bot import MockedBot
|
||||
|
||||
|
||||
@pytest.mark.skip
|
||||
class TestApproveChatJoinRequest:
|
||||
@pytest.mark.asyncio
|
||||
async def test_method(self, bot: MockedBot):
|
||||
prepare_result = bot.add_result_for(ApproveChatJoinRequest, ok=True, result=None)
|
||||
prepare_result = bot.add_result_for(ApproveChatJoinRequest, ok=True, result=True)
|
||||
|
||||
response: bool = await ApproveChatJoinRequest(
|
||||
chat_id=...,
|
||||
user_id=...,
|
||||
chat_id=-42,
|
||||
user_id=42,
|
||||
)
|
||||
request: Request = bot.get_request()
|
||||
assert request.method == "approveChatJoinRequest"
|
||||
# assert request.data == {}
|
||||
assert response == prepare_result.result
|
||||
|
||||
@pytest.mark.asyncio
|
||||
|
|
@ -24,10 +22,9 @@ class TestApproveChatJoinRequest:
|
|||
prepare_result = bot.add_result_for(ApproveChatJoinRequest, ok=True, result=None)
|
||||
|
||||
response: bool = await bot.approve_chat_join_request(
|
||||
chat_id=...,
|
||||
user_id=...,
|
||||
chat_id=-42,
|
||||
user_id=42,
|
||||
)
|
||||
request: Request = bot.get_request()
|
||||
assert request.method == "approveChatJoinRequest"
|
||||
# assert request.data == {}
|
||||
assert response == prepare_result.result
|
||||
|
|
|
|||
|
|
@ -1,18 +1,17 @@
|
|||
import pytest
|
||||
|
||||
from aiogram.api.methods import BanChatSenderChat, Request
|
||||
from aiogram.methods import BanChatSenderChat, Request
|
||||
from tests.mocked_bot import MockedBot
|
||||
|
||||
|
||||
@pytest.mark.skip
|
||||
class TestBanChatSenderChat:
|
||||
@pytest.mark.asyncio
|
||||
async def test_method(self, bot: MockedBot):
|
||||
prepare_result = bot.add_result_for(BanChatSenderChat, ok=True, result=None)
|
||||
prepare_result = bot.add_result_for(BanChatSenderChat, ok=True, result=True)
|
||||
|
||||
response: bool = await BanChatSenderChat(
|
||||
chat_id=...,
|
||||
sender_chat_id=...,
|
||||
chat_id=-42,
|
||||
sender_chat_id=-1337,
|
||||
)
|
||||
request: Request = bot.get_request()
|
||||
assert request.method == "banChatSenderChat"
|
||||
|
|
@ -21,11 +20,11 @@ class TestBanChatSenderChat:
|
|||
|
||||
@pytest.mark.asyncio
|
||||
async def test_bot_method(self, bot: MockedBot):
|
||||
prepare_result = bot.add_result_for(BanChatSenderChat, ok=True, result=None)
|
||||
prepare_result = bot.add_result_for(BanChatSenderChat, ok=True, result=True)
|
||||
|
||||
response: bool = await bot.ban_chat_sender_chat(
|
||||
chat_id=...,
|
||||
sender_chat_id=...,
|
||||
chat_id=-42,
|
||||
sender_chat_id=-1337,
|
||||
)
|
||||
request: Request = bot.get_request()
|
||||
assert request.method == "banChatSenderChat"
|
||||
|
|
|
|||
|
|
@ -1,33 +1,30 @@
|
|||
import pytest
|
||||
|
||||
from aiogram.api.methods import DeclineChatJoinRequest, Request
|
||||
from aiogram.methods import DeclineChatJoinRequest, Request
|
||||
from tests.mocked_bot import MockedBot
|
||||
|
||||
|
||||
@pytest.mark.skip
|
||||
class TestDeclineChatJoinRequest:
|
||||
@pytest.mark.asyncio
|
||||
async def test_method(self, bot: MockedBot):
|
||||
prepare_result = bot.add_result_for(DeclineChatJoinRequest, ok=True, result=None)
|
||||
prepare_result = bot.add_result_for(DeclineChatJoinRequest, ok=True, result=True)
|
||||
|
||||
response: bool = await DeclineChatJoinRequest(
|
||||
chat_id=...,
|
||||
user_id=...,
|
||||
chat_id=-42,
|
||||
user_id=42,
|
||||
)
|
||||
request: Request = bot.get_request()
|
||||
assert request.method == "declineChatJoinRequest"
|
||||
# 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(DeclineChatJoinRequest, ok=True, result=None)
|
||||
prepare_result = bot.add_result_for(DeclineChatJoinRequest, ok=True, result=True)
|
||||
|
||||
response: bool = await bot.decline_chat_join_request(
|
||||
chat_id=...,
|
||||
user_id=...,
|
||||
chat_id=-42,
|
||||
user_id=42,
|
||||
)
|
||||
request: Request = bot.get_request()
|
||||
assert request.method == "declineChatJoinRequest"
|
||||
# assert request.data == {}
|
||||
assert response == prepare_result.result
|
||||
|
|
|
|||
|
|
@ -1,18 +1,17 @@
|
|||
import pytest
|
||||
|
||||
from aiogram.api.methods import Request, UnbanChatSenderChat
|
||||
from aiogram.methods import Request, UnbanChatSenderChat
|
||||
from tests.mocked_bot import MockedBot
|
||||
|
||||
|
||||
@pytest.mark.skip
|
||||
class TestUnbanChatSenderChat:
|
||||
@pytest.mark.asyncio
|
||||
async def test_method(self, bot: MockedBot):
|
||||
prepare_result = bot.add_result_for(UnbanChatSenderChat, ok=True, result=None)
|
||||
prepare_result = bot.add_result_for(UnbanChatSenderChat, ok=True, result=True)
|
||||
|
||||
response: bool = await UnbanChatSenderChat(
|
||||
chat_id=...,
|
||||
sender_chat_id=...,
|
||||
chat_id=-42,
|
||||
sender_chat_id=-1337,
|
||||
)
|
||||
request: Request = bot.get_request()
|
||||
assert request.method == "unbanChatSenderChat"
|
||||
|
|
@ -21,11 +20,11 @@ class TestUnbanChatSenderChat:
|
|||
|
||||
@pytest.mark.asyncio
|
||||
async def test_bot_method(self, bot: MockedBot):
|
||||
prepare_result = bot.add_result_for(UnbanChatSenderChat, ok=True, result=None)
|
||||
prepare_result = bot.add_result_for(UnbanChatSenderChat, ok=True, result=True)
|
||||
|
||||
response: bool = await bot.unban_chat_sender_chat(
|
||||
chat_id=...,
|
||||
sender_chat_id=...,
|
||||
chat_id=-42,
|
||||
sender_chat_id=-1337,
|
||||
)
|
||||
request: Request = bot.get_request()
|
||||
assert request.method == "unbanChatSenderChat"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue