mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-12 18:19:34 +00:00
Merge remote-tracking branch 'origin/dev-3.x' into dev-3.x
This commit is contained in:
commit
d8e943424a
105 changed files with 2522 additions and 407 deletions
|
|
@ -0,0 +1,20 @@
|
|||
from aiogram.methods import CloseGeneralForumTopic, Request
|
||||
from tests.mocked_bot import MockedBot
|
||||
|
||||
|
||||
class TestCloseGeneralForumTopic:
|
||||
async def test_method(self, bot: MockedBot):
|
||||
prepare_result = bot.add_result_for(CloseGeneralForumTopic, ok=True, result=True)
|
||||
|
||||
response: bool = await bot(CloseGeneralForumTopic(chat_id=42))
|
||||
request: Request = bot.get_request()
|
||||
assert request.method == "closeGeneralForumTopic"
|
||||
assert response == prepare_result.result
|
||||
|
||||
async def test_bot_method(self, bot: MockedBot):
|
||||
prepare_result = bot.add_result_for(CloseGeneralForumTopic, ok=True, result=True)
|
||||
|
||||
response: bool = await bot.close_general_forum_topic(chat_id=42)
|
||||
request: Request = bot.get_request()
|
||||
assert request.method == "closeGeneralForumTopic"
|
||||
assert response == prepare_result.result
|
||||
20
tests/test_api/test_methods/test_edit_general_forum_topic.py
Normal file
20
tests/test_api/test_methods/test_edit_general_forum_topic.py
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
from aiogram.methods import EditGeneralForumTopic, Request
|
||||
from tests.mocked_bot import MockedBot
|
||||
|
||||
|
||||
class TestCloseGeneralForumTopic:
|
||||
async def test_method(self, bot: MockedBot):
|
||||
prepare_result = bot.add_result_for(EditGeneralForumTopic, ok=True, result=True)
|
||||
|
||||
response: bool = await bot(EditGeneralForumTopic(chat_id=42, name="Test"))
|
||||
request: Request = bot.get_request()
|
||||
assert request.method == "editGeneralForumTopic"
|
||||
assert response == prepare_result.result
|
||||
|
||||
async def test_bot_method(self, bot: MockedBot):
|
||||
prepare_result = bot.add_result_for(EditGeneralForumTopic, ok=True, result=True)
|
||||
|
||||
response: bool = await bot.edit_general_forum_topic(chat_id=42, name="Test")
|
||||
request: Request = bot.get_request()
|
||||
assert request.method == "editGeneralForumTopic"
|
||||
assert response == prepare_result.result
|
||||
20
tests/test_api/test_methods/test_hide_general_forum_topic.py
Normal file
20
tests/test_api/test_methods/test_hide_general_forum_topic.py
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
from aiogram.methods import HideGeneralForumTopic, Request
|
||||
from tests.mocked_bot import MockedBot
|
||||
|
||||
|
||||
class TestHideGeneralForumTopic:
|
||||
async def test_method(self, bot: MockedBot):
|
||||
prepare_result = bot.add_result_for(HideGeneralForumTopic, ok=True, result=True)
|
||||
|
||||
response: bool = await bot(HideGeneralForumTopic(chat_id=42))
|
||||
request: Request = bot.get_request()
|
||||
assert request.method == "hideGeneralForumTopic"
|
||||
assert response == prepare_result.result
|
||||
|
||||
async def test_bot_method(self, bot: MockedBot):
|
||||
prepare_result = bot.add_result_for(HideGeneralForumTopic, ok=True, result=True)
|
||||
|
||||
response: bool = await bot.hide_general_forum_topic(chat_id=42)
|
||||
request: Request = bot.get_request()
|
||||
assert request.method == "hideGeneralForumTopic"
|
||||
assert response == prepare_result.result
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
from aiogram.methods import ReopenGeneralForumTopic, Request
|
||||
from tests.mocked_bot import MockedBot
|
||||
|
||||
|
||||
class TestReopenGeneralForumTopic:
|
||||
async def test_method(self, bot: MockedBot):
|
||||
prepare_result = bot.add_result_for(ReopenGeneralForumTopic, ok=True, result=True)
|
||||
|
||||
response: bool = await bot(ReopenGeneralForumTopic(chat_id=42))
|
||||
request: Request = bot.get_request()
|
||||
assert request.method == "reopenGeneralForumTopic"
|
||||
assert response == prepare_result.result
|
||||
|
||||
async def test_bot_method(self, bot: MockedBot):
|
||||
prepare_result = bot.add_result_for(ReopenGeneralForumTopic, ok=True, result=True)
|
||||
|
||||
response: bool = await bot.reopen_general_forum_topic(chat_id=42)
|
||||
request: Request = bot.get_request()
|
||||
assert request.method == "reopenGeneralForumTopic"
|
||||
assert response == prepare_result.result
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
from aiogram.methods import Request, UnhideGeneralForumTopic
|
||||
from tests.mocked_bot import MockedBot
|
||||
|
||||
|
||||
class TestUnhideGeneralForumTopic:
|
||||
async def test_method(self, bot: MockedBot):
|
||||
prepare_result = bot.add_result_for(UnhideGeneralForumTopic, ok=True, result=True)
|
||||
|
||||
response: bool = await bot(UnhideGeneralForumTopic(chat_id=42))
|
||||
request: Request = bot.get_request()
|
||||
assert request.method == "unhideGeneralForumTopic"
|
||||
assert response == prepare_result.result
|
||||
|
||||
async def test_bot_method(self, bot: MockedBot):
|
||||
prepare_result = bot.add_result_for(UnhideGeneralForumTopic, ok=True, result=True)
|
||||
|
||||
response: bool = await bot.unhide_general_forum_topic(chat_id=42)
|
||||
request: Request = bot.get_request()
|
||||
assert request.method == "unhideGeneralForumTopic"
|
||||
assert response == prepare_result.result
|
||||
Loading…
Add table
Add a link
Reference in a new issue