Initial commit: Crypto trader application

This commit is contained in:
2025-12-25 20:20:40 -05:00
commit 07a04c1bb8
47895 changed files with 2042266 additions and 0 deletions

View 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