Initial commit
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
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)
|
||||
Reference in New Issue
Block a user