Revert re-generated tests

This commit is contained in:
Alex Root Junior 2022-04-19 18:45:17 +03:00
parent 8a37958e82
commit e5644248f9
No known key found for this signature in database
GPG key ID: 074C1D455EBEA4AC
4 changed files with 27 additions and 35 deletions

View file

@ -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

View file

@ -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"

View file

@ -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

View file

@ -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"