Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implemented tests #731

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 44 additions & 1 deletion app/test_main.py
Original file line number Diff line number Diff line change
@@ -1 +1,44 @@
# write your code here
import pytest

from app.main import check_password


@pytest.mark.parametrize("password,expected_result",
[
pytest.param("Pass@word1", True,
id="\'Pass@word1\' "
"is correct password"),

pytest.param("Pass@worФ1", False,
id="\'Pass@worФ1\' "
"contains non latin symbol"),

pytest.param("Pass@wor+1", False,
id="\'Pass@wor+1\' "
"contains non allowed"
" symbol/'+/'"),

pytest.param("Pass@w1", False,
id="\'Pass@w1\' "
"contains less than 8 symbols"),

pytest.param("Pass@worqqqqqqqq1", False,
id="\'Pass@worqqqqqqqq1\' "
"contains more than 16 symbols"),

pytest.param("Passsword1", False,
id="\'Passsword1\' "
"contains no special symbols"),

pytest.param("pass@word1", False,
id="\'pass@word1\' "
"contains no upper case symbols"),

pytest.param("Pass@wordd", False,
id="\'Pass@wordd\' "
"contains no digits"),
]

)
def test_check_password(password: str, expected_result: bool) -> None:
assert expected_result == check_password(password)
Loading