Initial commit
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
from core.crypto_manager import CryptoManager
|
||||
|
||||
|
||||
def test_encrypt_decrypt_file(tmp_path):
|
||||
file = tmp_path / "plain.txt"
|
||||
file.write_text("super secret", encoding="utf-8")
|
||||
|
||||
enc_file = tmp_path / "plain.enc"
|
||||
dec_file = tmp_path / "plain.dec"
|
||||
|
||||
crypto = CryptoManager()
|
||||
key = crypto.generate_key()
|
||||
|
||||
crypto.encrypt_file(file, key, enc_file)
|
||||
crypto.decrypt_file(enc_file, key, dec_file)
|
||||
|
||||
assert dec_file.read_text(encoding="utf-8") == "super secret"
|
||||
Reference in New Issue
Block a user