mirror of
https://github.com/azaion/ai-training.git
synced 2026-04-22 10:36:35 +00:00
0841e095c8
Made-with: Cursor
19 lines
417 B
Python
19 lines
417 B
Python
import os
|
|
import time
|
|
|
|
import pytest
|
|
|
|
from security import Security
|
|
|
|
|
|
@pytest.mark.performance
|
|
def test_pt_enc_01_encrypt_decrypt_10mb_within_five_seconds():
|
|
key = "test-key"
|
|
data = os.urandom(10 * 1024 * 1024)
|
|
t0 = time.perf_counter()
|
|
enc = Security.encrypt_to(data, key)
|
|
out = Security.decrypt_to(enc, key)
|
|
elapsed = time.perf_counter() - t0
|
|
assert elapsed <= 5.0
|
|
assert out == data
|