tests/conftest.py
| 1 | """Pytest fixtures for pqc-enclave-sdk.""" |
| 2 | |
| 3 | from __future__ import annotations |
| 4 | |
| 5 | import os |
| 6 | |
| 7 | import pytest |
| 8 | from quantumshield.identity.agent import AgentIdentity |
| 9 | |
| 10 | from pqc_enclave_sdk import ( |
| 11 | EnclaveVault, |
| 12 | InMemoryEnclaveBackend, |
| 13 | ) |
| 14 | |
| 15 | |
| 16 | @pytest.fixture |
| 17 | def signer_identity() -> AgentIdentity: |
| 18 | return AgentIdentity.create("test-device-signer") |
| 19 | |
| 20 | |
| 21 | @pytest.fixture |
| 22 | def backend() -> InMemoryEnclaveBackend: |
| 23 | return InMemoryEnclaveBackend( |
| 24 | device_id="iphone-alice-test", |
| 25 | device_model="iphone-15-pro", |
| 26 | ) |
| 27 | |
| 28 | |
| 29 | @pytest.fixture |
| 30 | def vault(backend: InMemoryEnclaveBackend) -> EnclaveVault: |
| 31 | v = EnclaveVault(backend=backend) |
| 32 | v.unlock() |
| 33 | return v |
| 34 | |
| 35 | |
| 36 | @pytest.fixture |
| 37 | def small_weights() -> bytes: |
| 38 | return os.urandom(512) |
| 39 | |
| 40 | |
| 41 | @pytest.fixture |
| 42 | def api_credential() -> bytes: |
| 43 | return b"sk-test-abc" |
| 44 | |