Files

13 lines
338 B
Python
Raw Permalink Normal View History

2026-07-12 14:06:45 +04:00
import pytest
from core.password_hasher import PasswordHasher
def test_hash_and_verify():
hasher = PasswordHasher()
salt = hasher.generate_salt()
pwd = "secret123"
hashed = hasher.hash_password(pwd, salt)
assert hasher.verify_password(pwd, salt, hashed)
assert not hasher.verify_password("wrong", salt, hashed)