Local changes: Updated model training, removed debug instrumentation, and configuration improvements
This commit is contained in:
2
tests/unit/security/__init__.py
Normal file
2
tests/unit/security/__init__.py
Normal file
@@ -0,0 +1,2 @@
|
||||
"""Unit tests for security."""
|
||||
|
||||
35
tests/unit/security/test_encryption.py
Normal file
35
tests/unit/security/test_encryption.py
Normal file
@@ -0,0 +1,35 @@
|
||||
"""Tests for encryption."""
|
||||
|
||||
import pytest
|
||||
from src.security.encryption import get_encryption_manager, EncryptionManager
|
||||
|
||||
|
||||
class TestEncryption:
|
||||
"""Tests for encryption system."""
|
||||
|
||||
@pytest.fixture
|
||||
def encryptor(self):
|
||||
"""Create encryption manager."""
|
||||
return get_encryption_manager()
|
||||
|
||||
def test_encrypt_decrypt(self, encryptor):
|
||||
"""Test encryption and decryption."""
|
||||
plaintext = "test_api_key_12345"
|
||||
|
||||
encrypted = encryptor.encrypt(plaintext)
|
||||
assert encrypted != plaintext
|
||||
assert len(encrypted) > 0
|
||||
|
||||
decrypted = encryptor.decrypt(encrypted)
|
||||
assert decrypted == plaintext
|
||||
|
||||
def test_encrypt_different_values(self, encryptor):
|
||||
"""Test that different values encrypt differently."""
|
||||
value1 = "key1"
|
||||
value2 = "key2"
|
||||
|
||||
encrypted1 = encryptor.encrypt(value1)
|
||||
encrypted2 = encryptor.encrypt(value2)
|
||||
|
||||
assert encrypted1 != encrypted2
|
||||
|
||||
Reference in New Issue
Block a user