mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
refator: use MessageFactory instead of Message, just a part
This commit is contained in:
parent
0e005f661c
commit
5a561ea5a3
13 changed files with 37 additions and 78 deletions
|
|
@ -11,12 +11,7 @@ from tests.mocked_bot import MockedBot
|
|||
class TestSendMessage:
|
||||
@pytest.mark.asyncio
|
||||
async def test_method(self, bot: MockedBot):
|
||||
prepare_result = bot.add_result_for(
|
||||
SendMessage,
|
||||
ok=True,
|
||||
result=MessageFactory(
|
||||
),
|
||||
)
|
||||
prepare_result = bot.add_result_for(SendMessage, ok=True, result=MessageFactory())
|
||||
|
||||
response: Message = await SendMessage(chat_id=42, text="test")
|
||||
request: Request = bot.get_request()
|
||||
|
|
@ -25,12 +20,7 @@ class TestSendMessage:
|
|||
|
||||
@pytest.mark.asyncio
|
||||
async def test_bot_method(self, bot: MockedBot):
|
||||
prepare_result = bot.add_result_for(
|
||||
SendMessage,
|
||||
ok=True,
|
||||
result=MessageFactory(
|
||||
),
|
||||
)
|
||||
prepare_result = bot.add_result_for(SendMessage, ok=True, result=MessageFactory())
|
||||
|
||||
response: Message = await bot.send_message(chat_id=42, text="test")
|
||||
request: Request = bot.get_request()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue