| 12345678910111213141516171819202122232425262728293031323334353637383940 |
- from pathlib import Path
- ROOT = Path(__file__).resolve().parents[1]
- def test_domain_template_migration_is_additive_versioned_and_auditable():
- migration = (
- ROOT
- / "migrations"
- / "versions"
- / "20260730_370_governance_domain_templates.py"
- ).read_text(encoding="utf-8")
- assert 'revision = "20260730_370"' in migration
- assert 'down_revision = "20260730_360"' in migration
- for table in (
- "governance_domain_templates",
- "governance_domain_template_versions",
- "governance_object_types",
- "governance_domain_template_imports",
- ):
- assert f"CREATE TABLE public.{table}" in migration
- assert "definition JSONB NOT NULL" in migration
- assert "source_identity_fields JSONB NOT NULL" in migration
- assert "before_state JSONB" in migration
- assert "after_state JSONB NOT NULL" in migration
- assert "operation IN ('import','rollback')" in migration
- assert "DROP TABLE" not in migration.upper()
- def test_release_copy_will_include_domain_template_runtime():
- for relative in (
- "core/governance/domain_templates.py",
- "core/governance/domain_template_repository.py",
- "api/meta_data/domain_templates.py",
- "models/governance_template.py",
- ):
- assert (ROOT / "app" / relative).read_bytes() == (
- ROOT / "deployment" / "app" / relative
- ).read_bytes()
|