staking-deposit-cli/tests/test_utils/test_validation.py
Hsiao-Wei Wang 076469a531
Add password length validation - take 2 (#138)
* [WIP] Add password length validation

* Workaround: use click callback function

* Minor rewording
2020-10-27 14:05:12 +08:00

20 lines
490 B
Python

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)