13 lines
338 B
Python
13 lines
338 B
Python
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)
|