mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
* Add set_chat_member_tag shortcut coverage * Add set_member_tag shortcut tests and align decoration expectations * Fix follow-up test coverage for sender_tag and can_edit_tag * Add changelog fragment for PR 1781 * Align changelog with base PR #1780 * Expand 1780 changelog to cover base and follow-up scope * Treat sender_tag as metadata, not message content type --------- Co-authored-by: Latand <latand@users.noreply.github.com> Co-authored-by: Codex Agent <codex@openclaw.local>
This commit is contained in:
parent
251df4b193
commit
ebfab22d64
13 changed files with 202 additions and 8 deletions
|
|
@ -9,6 +9,7 @@ from aiogram.utils.formatting import (
|
|||
CashTag,
|
||||
Code,
|
||||
CustomEmoji,
|
||||
DateTime,
|
||||
Email,
|
||||
ExpandableBlockQuote,
|
||||
HashTag,
|
||||
|
|
@ -93,7 +94,7 @@ class TestNode:
|
|||
],
|
||||
[
|
||||
Pre("test", language="python"),
|
||||
'<pre><code class="language-python">test</code></pre>',
|
||||
'<pre><code language="language-python">test</code></pre>',
|
||||
],
|
||||
[
|
||||
TextLink("test", url="https://example.com"),
|
||||
|
|
@ -105,7 +106,7 @@ class TestNode:
|
|||
],
|
||||
[
|
||||
CustomEmoji("test", custom_emoji_id="42"),
|
||||
'<tg-emoji emoji-id="42">test</tg-emoji>',
|
||||
'<tg-emoji emoji_id="42">test</tg-emoji>',
|
||||
],
|
||||
[
|
||||
BlockQuote("test"),
|
||||
|
|
@ -115,6 +116,10 @@ class TestNode:
|
|||
ExpandableBlockQuote("test"),
|
||||
"<blockquote expandable>test</blockquote>",
|
||||
],
|
||||
[
|
||||
DateTime("test", unix_time=42, date_time_format="yMd"),
|
||||
'<tg-time unix="42" format="yMd">test</tg-time>',
|
||||
],
|
||||
],
|
||||
)
|
||||
def test_render_plain_only(self, node: Text, result: str):
|
||||
|
|
@ -358,6 +363,22 @@ class TestUtils:
|
|||
assert isinstance(node, Bold)
|
||||
assert node._body == ("test",)
|
||||
|
||||
def test_apply_entity_date_time(self):
|
||||
node = _apply_entity(
|
||||
MessageEntity(
|
||||
type=MessageEntityType.DATE_TIME,
|
||||
offset=0,
|
||||
length=4,
|
||||
unix_time=42,
|
||||
date_time_format="yMd",
|
||||
),
|
||||
"test",
|
||||
)
|
||||
assert isinstance(node, DateTime)
|
||||
assert node._body == ("test",)
|
||||
assert node._params["unix_time"] == 42
|
||||
assert node._params["date_time_format"] == "yMd"
|
||||
|
||||
def test_as_line(self):
|
||||
node = as_line("test", "test", "test")
|
||||
assert isinstance(node, Text)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue