You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
1.3 KiB
38 lines
1.3 KiB
import pytest
|
|
|
|
from corvus import errors
|
|
from corvus.service import authentication_service
|
|
|
|
|
|
def test_validate_password_strength_good_password():
|
|
proposed_good_password = 'AazZ1001'
|
|
assert proposed_good_password == authentication_service\
|
|
.validate_password_strength(proposed_good_password)
|
|
|
|
|
|
def test_validate_password_strength_too_short():
|
|
proposed_good_password = 'AazZ100'
|
|
with pytest.raises(errors.ValidationError) as error_info:
|
|
authentication_service.validate_password_strength(
|
|
proposed_good_password)
|
|
|
|
|
|
def test_validate_password_strength_missing_uppercase():
|
|
proposed_good_password = 'aazz1001'
|
|
with pytest.raises(errors.ValidationError) as error_info:
|
|
authentication_service.validate_password_strength(
|
|
proposed_good_password)
|
|
|
|
|
|
def test_validate_password_strength_missing_lowercase():
|
|
proposed_good_password = 'AAZZ1001'
|
|
with pytest.raises(errors.ValidationError) as error_info:
|
|
authentication_service.validate_password_strength(
|
|
proposed_good_password)
|
|
|
|
|
|
def test_validate_password_strength_missing_numbers():
|
|
proposed_good_password = 'AAZZZZAA'
|
|
with pytest.raises(errors.ValidationError) as error_info:
|
|
authentication_service.validate_password_strength(
|
|
proposed_good_password)
|