|
| 1 | +from __future__ import annotations |
| 2 | + |
| 3 | +import ix_autonomy_assurance_case_runtime as ix |
| 4 | + |
| 5 | + |
| 6 | +CAPABILITY_EXPORT_GROUPS = { |
| 7 | + "registry-layer": ( |
| 8 | + "REGISTRY_CAPABILITY_ID", |
| 9 | + "RegistryLayerReadinessEvaluator", |
| 10 | + "RegistryLayerReadinessReport", |
| 11 | + "RegistryReadinessDecision", |
| 12 | + ), |
| 13 | + "policy-pack-engine": ( |
| 14 | + "POLICY_CAPABILITY_ID", |
| 15 | + "PolicyLayerReadinessEvaluator", |
| 16 | + "PolicyLayerReadinessReport", |
| 17 | + "PolicyLayerReadinessDecision", |
| 18 | + ), |
| 19 | + "framework-crosswalks": ( |
| 20 | + "FRAMEWORK_CROSSWALK_CAPABILITY_ID", |
| 21 | + "FrameworkCrosswalkLayerReadinessEvaluator", |
| 22 | + "FrameworkCrosswalkLayerReadinessReport", |
| 23 | + "FrameworkCrosswalkReadinessDecision", |
| 24 | + ), |
| 25 | + "signed-provenance": ( |
| 26 | + "PROVENANCE_CAPABILITY_ID", |
| 27 | + "ProvenanceLayerReadinessEvaluator", |
| 28 | + "ProvenanceLayerReadinessReport", |
| 29 | + "ProvenanceReadinessDecision", |
| 30 | + ), |
| 31 | + "telemetry-adapters": ( |
| 32 | + "TELEMETRY_CAPABILITY_ID", |
| 33 | + "TelemetryLayerReadinessEvaluator", |
| 34 | + "TelemetryLayerReadinessReport", |
| 35 | + "TelemetryReadinessDecision", |
| 36 | + ), |
| 37 | + "scenario-campaign-runner": ( |
| 38 | + "SCENARIO_CAMPAIGN_CAPABILITY_ID", |
| 39 | + "ScenarioCampaignLayerReadinessEvaluator", |
| 40 | + "ScenarioCampaignLayerReadinessReport", |
| 41 | + "ScenarioCampaignReadinessDecision", |
| 42 | + ), |
| 43 | + "monitoring-incidents": ( |
| 44 | + "MONITORING_CAPABILITY_ID", |
| 45 | + "MonitoringLayerReadinessEvaluator", |
| 46 | + "MonitoringLayerReadinessReport", |
| 47 | + "MonitoringReadinessDecision", |
| 48 | + ), |
| 49 | + "review-workflow": ( |
| 50 | + "REVIEW_WORKFLOW_CAPABILITY_ID", |
| 51 | + "ReviewWorkflowLayerReadinessEvaluator", |
| 52 | + "ReviewWorkflowLayerReadinessReport", |
| 53 | + "ReviewWorkflowReadinessDecision", |
| 54 | + ), |
| 55 | + "audit-report-export": ( |
| 56 | + "EXPORT_PACKAGE_CAPABILITY_ID", |
| 57 | + "ExportPackageLayerReadinessEvaluator", |
| 58 | + "ExportPackageLayerReadinessReport", |
| 59 | + "ExportPackageReadinessDecision", |
| 60 | + ), |
| 61 | + "assurance-dossier": ( |
| 62 | + "ASSURANCE_DOSSIER_CAPABILITY_ID", |
| 63 | + "AssuranceDossierLayerReadinessEvaluator", |
| 64 | + "AssuranceDossierLayerReadinessReport", |
| 65 | + "AssuranceDossierReadinessDecision", |
| 66 | + ), |
| 67 | + "claim-guardrails": ( |
| 68 | + "CLAIM_GUARDRAIL_CAPABILITY_ID", |
| 69 | + "ClaimGuardrailLayerReadinessEvaluator", |
| 70 | + "ClaimGuardrailLayerReadinessReport", |
| 71 | + "ClaimGuardrailReadinessDecision", |
| 72 | + ), |
| 73 | + "federal-evaluation-profile": ( |
| 74 | + "FEDERAL_EVALUATION_PROFILE_CAPABILITY_ID", |
| 75 | + "FederalEvaluationLayerReadinessEvaluator", |
| 76 | + "FederalEvaluationLayerReadinessReport", |
| 77 | + "FederalEvaluationReadinessDecision", |
| 78 | + ), |
| 79 | +} |
| 80 | + |
| 81 | + |
| 82 | +def test_public_api_exports_all_twelve_capability_readiness_surfaces() -> None: |
| 83 | + for capability_id, export_names in CAPABILITY_EXPORT_GROUPS.items(): |
| 84 | + constant_name = export_names[0] |
| 85 | + |
| 86 | + assert getattr(ix, constant_name) == capability_id |
| 87 | + for export_name in export_names: |
| 88 | + assert export_name in ix.__all__ |
| 89 | + assert hasattr(ix, export_name) |
| 90 | + |
| 91 | + |
| 92 | +def test_public_api_exports_maturity_and_rollup_entry_points() -> None: |
| 93 | + expected_exports = ( |
| 94 | + "BASELINE_MATURITY_PERCENT", |
| 95 | + "SERIOUS_PROTOTYPE_TARGET_PERCENT", |
| 96 | + "PrototypeCapabilityArea", |
| 97 | + "PrototypeCapabilityTarget", |
| 98 | + "PrototypeMaturityAssessment", |
| 99 | + "PrototypeClaimLevel", |
| 100 | + "PrototypeReadinessGate", |
| 101 | + "PrototypeReadinessReport", |
| 102 | + "CapabilityLayerReport", |
| 103 | + "CapabilityLayerRollupEntry", |
| 104 | + "PrototypeCapabilityRollupEvaluator", |
| 105 | + "PrototypeCapabilityRollupReport", |
| 106 | + "build_serious_prototype_targets", |
| 107 | + "assess_serious_prototype_maturity", |
| 108 | + ) |
| 109 | + |
| 110 | + for export_name in expected_exports: |
| 111 | + assert export_name in ix.__all__ |
| 112 | + assert hasattr(ix, export_name) |
| 113 | + |
| 114 | + |
| 115 | +def test_public_api_all_tuple_has_no_duplicates() -> None: |
| 116 | + assert len(ix.__all__) == len(set(ix.__all__)) |
0 commit comments