mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-11 01:54:53 +00:00
Auto-generate tests for methods
This commit is contained in:
parent
17edffdc62
commit
567584b741
64 changed files with 1838 additions and 0 deletions
30
tests/test_api/test_methods/test_send_venue.py
Normal file
30
tests/test_api/test_methods/test_send_venue.py
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
import pytest
|
||||
from aiogram.api.methods import Request, SendVenue
|
||||
from tests.mocked_bot import MockedBot
|
||||
|
||||
|
||||
@pytest.mark.skip
|
||||
class TestSendVenue:
|
||||
@pytest.mark.asyncio
|
||||
async def test_method(self, bot: MockedBot):
|
||||
prepare_result = bot.add_result_for(SendVenue, ok=True, result=None)
|
||||
|
||||
response: Message = await SendVenue(
|
||||
chat_id=..., latitude=..., longitude=..., title=..., address=...,
|
||||
)
|
||||
request: Request = bot.get_request()
|
||||
assert request.method == "sendVenue"
|
||||
# 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(SendVenue, ok=True, result=None)
|
||||
|
||||
response: Message = await bot.send_venue(
|
||||
chat_id=..., latitude=..., longitude=..., title=..., address=...,
|
||||
)
|
||||
request: Request = bot.get_request()
|
||||
assert request.method == "sendVenue"
|
||||
# assert request.data == {}
|
||||
assert response == prepare_result.result
|
||||
Loading…
Add table
Add a link
Reference in a new issue