Skip to content

Commit

Permalink
added test_generate_username
Browse files Browse the repository at this point in the history
  • Loading branch information
Slava Maltsev committed Oct 10, 2022
1 parent 8cf3f61 commit 8b05097
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/create_users_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,3 +181,18 @@ def test_complex_operations(self, db_conn, fake_transaction, fake_select):
("added_5", "added_5_username", "added_5_password"),
("0", "0_username", "0_password")
]

class Test_generation:
@pytest.mark.parametrize(
"telegram_username, account_username",
[
("slava", "slava_test_Annotator"),
("123456789", "123456789_test_Annotator"),
("test_test_test_test", "test_test_test_test_test_Annotator")
]
)
def test_generate_username(self, telegram_username, account_username):
from create_users.generation import generate_username

assert generate_username(telegram_username) == account_username

0 comments on commit 8b05097

Please sign in to comment.