mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-13 18:43:53 +00:00
Bot API 6.8 (#1276)
* Prepare for Bot API 6.8 * Bump after public release * Bump version, added changelog
This commit is contained in:
parent
bc0932a745
commit
678b3cfe7d
29 changed files with 363 additions and 27 deletions
|
|
@ -0,0 +1,15 @@
|
|||
from aiogram.methods import Request, UnpinAllForumTopicMessages, UnpinAllGeneralForumTopicMessages
|
||||
from tests.mocked_bot import MockedBot
|
||||
|
||||
|
||||
class TestUnpinAllForumTopicMessages:
|
||||
async def test_bot_method(self, bot: MockedBot):
|
||||
prepare_result = bot.add_result_for(
|
||||
UnpinAllGeneralForumTopicMessages, ok=True, result=True
|
||||
)
|
||||
|
||||
response: bool = await bot.unpin_all_general_forum_topic_messages(
|
||||
chat_id=42,
|
||||
)
|
||||
request = bot.get_request()
|
||||
assert response == prepare_result.result
|
||||
|
|
@ -207,3 +207,9 @@ class TestChat:
|
|||
):
|
||||
chat = Chat(id=42, first_name=first, last_name=last, title=title, type=chat_type)
|
||||
assert chat.full_name == result
|
||||
|
||||
def test_unpin_all_general_forum_topic_messages(self):
|
||||
chat = Chat(id=-42, type="supergroup")
|
||||
|
||||
method = chat.unpin_all_general_forum_topic_messages()
|
||||
assert method.chat_id == chat.id
|
||||
|
|
|
|||
|
|
@ -73,6 +73,7 @@ from aiogram.types import (
|
|||
VideoNote,
|
||||
Voice,
|
||||
WebAppData,
|
||||
Story,
|
||||
)
|
||||
from aiogram.types.message import ContentType, Message
|
||||
|
||||
|
|
@ -455,6 +456,15 @@ TEST_CHAT_SHARED = Message(
|
|||
from_user=User(id=42, is_bot=False, first_name="Test"),
|
||||
chat_shared=ChatShared(request_id=42, chat_id=42),
|
||||
)
|
||||
TEST_MESSAGE_STORY = Message(
|
||||
message_id=42,
|
||||
date=datetime.datetime.now(),
|
||||
chat=Chat(id=42, type="private"),
|
||||
from_user=User(id=42, is_bot=False, first_name="Test"),
|
||||
story=Story(),
|
||||
forward_signature="Test",
|
||||
forward_date=datetime.datetime.now(),
|
||||
)
|
||||
TEST_MESSAGE_UNKNOWN = Message(
|
||||
message_id=42,
|
||||
date=datetime.datetime.now(),
|
||||
|
|
@ -516,6 +526,7 @@ class TestMessage:
|
|||
[TEST_FORUM_TOPIC_REOPENED, ContentType.FORUM_TOPIC_REOPENED],
|
||||
[TEST_USER_SHARED, ContentType.USER_SHARED],
|
||||
[TEST_CHAT_SHARED, ContentType.CHAT_SHARED],
|
||||
[TEST_MESSAGE_STORY, ContentType.STORY],
|
||||
[TEST_MESSAGE_UNKNOWN, ContentType.UNKNOWN],
|
||||
],
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue