mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Add full_name property to Contact and corresponding tests (#1758)
* Add full_name property to Contact and corresponding tests * Add brief description of changes
This commit is contained in:
parent
f2459fbcf2
commit
1708980ceb
3 changed files with 27 additions and 0 deletions
20
tests/test_api/test_types/test_contact.py
Normal file
20
tests/test_api/test_types/test_contact.py
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
import pytest
|
||||
|
||||
from aiogram.types import Contact
|
||||
|
||||
|
||||
class TestContact:
|
||||
@pytest.mark.parametrize(
|
||||
"first,last,result",
|
||||
[
|
||||
["User", None, "User"],
|
||||
["", None, ""],
|
||||
[" ", None, " "],
|
||||
["User", "Name", "User Name"],
|
||||
["User", " ", "User "],
|
||||
[" ", " ", " "],
|
||||
],
|
||||
)
|
||||
def test_full_name(self, first: str, last: str, result: bool):
|
||||
contact = Contact(phone_number="911", first_name=first, last_name=last)
|
||||
assert contact.full_name == result
|
||||
Loading…
Add table
Add a link
Reference in a new issue