Move root tests to src/tests and update configuration

This commit is contained in:
thePR0M3TH3AN
2025-07-01 12:23:18 -04:00
parent 5e4395d391
commit 297d31daca
7 changed files with 2 additions and 1 deletions

View File

@@ -0,0 +1,24 @@
import sys
from pathlib import Path
from tempfile import TemporaryDirectory
from cryptography.fernet import Fernet
from mnemonic import Mnemonic
sys.path.append(str(Path(__file__).resolve().parents[1]))
from password_manager.encryption import EncryptionManager
from password_manager.manager import PasswordManager
def test_seed_encryption_round_trip():
with TemporaryDirectory() as tmpdir:
key = Fernet.generate_key()
enc_mgr = EncryptionManager(key, Path(tmpdir))
seed = Mnemonic("english").generate(strength=128)
enc_mgr.encrypt_parent_seed(seed)
decrypted = enc_mgr.decrypt_parent_seed()
assert decrypted == seed
pm = PasswordManager.__new__(PasswordManager)
assert pm.validate_bip85_seed(seed)