staking-deposit-cli/tests/test_utils/test_validation.py

20 lines
490 B
Python
Raw Normal View History

import pytest
from eth2deposit.exceptions import ValidationError
from eth2deposit.utils.validation import validate_password_strength
@pytest.mark.parametrize(
'password, valid',
[
('12345678', True),
('1234567', False),
]
)
def test_validate_password_strength(password, valid):
if valid:
validate_password_strength(password=password)
else:
with pytest.raises(ValidationError):
validate_password_strength(password=password)