adding new tests

This commit is contained in:
sheldygg 2022-10-31 09:10:18 +02:00
parent 293186cc08
commit 987c6d6e48
3 changed files with 42 additions and 2 deletions

View file

@ -15,6 +15,6 @@ class TestUser:
[" ", " ", " "],
],
)
def test_get_mention_html(self, first: str, last: str, result: bool):
def test_full_name(self, first: str, last: str, result: bool):
user = User(id=42, is_bot=False, first_name=first, last_name=last)
assert user.mention_html()
assert user.full_name == result

View file

@ -0,0 +1,20 @@
import pytest
from aiogram.types import User
class TestUser:
@pytest.mark.parametrize(
"first,last,result",
[
["User", None, "User"],
["", None, ""],
[" ", None, " "],
["User", "Name", "User Name"],
["User", " ", "User "],
[" ", " ", " "],
],
)
def test_get_mention_html(self, first: str, last: str, result: bool):
user = User(id=42, is_bot=False, first_name=first, last_name=last)
assert user.mention_html()

View file

@ -0,0 +1,20 @@
import pytest
from aiogram.types import User
class TestUser:
@pytest.mark.parametrize(
"first,last,result",
[
["User", None, "User"],
["", None, ""],
[" ", None, " "],
["User", "Name", "User Name"],
["User", " ", "User "],
[" ", " ", " "],
],
)
def test_get_mention_markdown(self, first: str, last: str, result: bool):
user = User(id=42, is_bot=False, first_name=first, last_name=last)
assert user.mention_markdown()