Seeded repo with intent and initial content.

This commit is contained in:
tegwick 2026-10-03 14:13:45 +02:00
parent 86b9063721
commit 12d0c31cff
27 changed files with 2683 additions and 1 deletions

35
tests/conftest.py Normal file
View file

@ -0,0 +1,35 @@
from __future__ import annotations
import pytest
from fixture_loading import ENVELOPES, load_yaml
from emergent_security.envelope import DefaultEnvelope
from emergent_security.scales import RiskScales
from emergent_security.tenant import PlatformTenantEnvelope, TenantContext, TenantGovernance
@pytest.fixture(scope="session")
def scales() -> RiskScales:
return RiskScales.load(ENVELOPES / "scales.yaml")
@pytest.fixture(scope="session")
def default_envelope() -> DefaultEnvelope:
return DefaultEnvelope.load(ENVELOPES / "default-envelope.yaml")
@pytest.fixture
def tenant_context_from():
"""Build a TenantContext from a fixture context dict (paths relative to envelopes/)."""
def build(context: dict) -> TenantContext | None:
if "platform_envelope" not in context:
return None
platform = PlatformTenantEnvelope.from_dict(load_yaml(ENVELOPES / context["platform_envelope"]))
governance = None
if "tenant_governance" in context:
governance = TenantGovernance.from_dict(load_yaml(ENVELOPES / context["tenant_governance"]))
return TenantContext(platform=platform, governance=governance)
return build