Enable 37 auto-generated tests

This commit is contained in:
Alex Root Junior 2019-11-19 00:04:02 +02:00
parent 567584b741
commit e1b2226d03
37 changed files with 387 additions and 287 deletions

View file

@ -1,17 +1,26 @@
import datetime
import pytest
from aiogram.api.methods import ForwardMessage, Request
from aiogram.api.types import Chat, Message
from tests.mocked_bot import MockedBot
@pytest.mark.skip
class TestForwardMessage:
@pytest.mark.asyncio
async def test_method(self, bot: MockedBot):
prepare_result = bot.add_result_for(ForwardMessage, ok=True, result=None)
response: Message = await ForwardMessage(
chat_id=..., from_chat_id=..., message_id=...,
prepare_result = bot.add_result_for(
ForwardMessage,
ok=True,
result=Message(
message_id=42,
date=datetime.datetime.now(),
chat=Chat(id=42, title="chat", type="private"),
text="text",
),
)
response: Message = await ForwardMessage(chat_id=42, from_chat_id=42, message_id=42)
request: Request = bot.get_request()
assert request.method == "forwardMessage"
# assert request.data == {}
@ -19,11 +28,18 @@ class TestForwardMessage:
@pytest.mark.asyncio
async def test_bot_method(self, bot: MockedBot):
prepare_result = bot.add_result_for(ForwardMessage, ok=True, result=None)
response: Message = await bot.forward_message(
chat_id=..., from_chat_id=..., message_id=...,
prepare_result = bot.add_result_for(
ForwardMessage,
ok=True,
result=Message(
message_id=42,
date=datetime.datetime.now(),
chat=Chat(id=42, title="chat", type="private"),
text="text",
),
)
response: Message = await bot.forward_message(chat_id=42, from_chat_id=42, message_id=42)
request: Request = bot.get_request()
assert request.method == "forwardMessage"
# assert request.data == {}