Add pytest config and key derivation tests

This commit is contained in:
thePR0M3TH3AN
2025-06-29 23:06:22 -04:00
parent c8b54fc791
commit 0088211193
3 changed files with 23 additions and 2 deletions

View File

@@ -0,0 +1,18 @@
import logging
import pytest
from utils.key_derivation import derive_key_from_password
def test_derive_key_deterministic():
password = "correct horse battery staple"
key1 = derive_key_from_password(password, iterations=1)
key2 = derive_key_from_password(password, iterations=1)
assert key1 == key2
assert len(key1) == 44
logging.info("Deterministic key derivation succeeded")
def test_derive_key_empty_password_error():
with pytest.raises(ValueError):
derive_key_from_password("")
logging.info("Empty password correctly raised ValueError")