Files
password-security-python/tests/test_cli.py

12 lines
333 B
Python

from salt import hash_password, main
def test_main_supports_hash_shortcut() -> None:
assert main(["secret"]) == 0
def test_main_verify_round_trip() -> None:
salt, hashed = hash_password("secret-value")
assert main(["verify", "secret-value", salt, hashed]) == 0
assert main(["verify", "wrong", salt, hashed]) == 1