mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Tests coverage
This commit is contained in:
parent
bc550382b8
commit
e0a4bc8f8b
2 changed files with 10 additions and 0 deletions
|
|
@ -74,6 +74,8 @@ class TextDecoration(ABC):
|
|||
if entity.type == MessageEntityType.CUSTOM_EMOJI:
|
||||
return self.custom_emoji(value=text, custom_emoji_id=cast(str, entity.custom_emoji_id))
|
||||
|
||||
# This case is not possible because of `if` above, but if any new entity is added to
|
||||
# API it will be here too
|
||||
return self.quote(text)
|
||||
|
||||
def unparse(self, text: str, entities: Optional[List[MessageEntity]] = None) -> str:
|
||||
|
|
|
|||
|
|
@ -113,6 +113,14 @@ class TestTextDecoration:
|
|||
):
|
||||
assert decorator.apply_entity(entity, "test") == result
|
||||
|
||||
def test_unknown_apply_entity(self):
|
||||
assert (
|
||||
html_decoration.apply_entity(
|
||||
MessageEntity(type="unknown", offset=0, length=5), "<test>"
|
||||
)
|
||||
== "<test>"
|
||||
)
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"decorator,before,after",
|
||||
[
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue