from __future__ import annotations import unittest from pathlib import Path from scripts.create_serviceification_candidate_receipt import PRODUCER_CLOSURE_PATHS from scripts import validate_serviceification_bom REPO_ROOT = Path(__file__).resolve().parents[1] class D1MetadataAuthorityTests(unittest.TestCase): def test_candidate_producer_verifies_the_final_pack_app_release_closure( self, ) -> None: workflow = ( REPO_ROOT / ".github/workflows/produce-serviceification-test-stack-candidate.yml" ).read_text() self.assertIn( "Verify AppRelease and L2 final-pack assembly closure", workflow, ) self.assertIn( "publisher/scripts/verify_serviceification_d1_metadata_authority.py", workflow, ) self.assertIn("--require-desired", workflow) self.assertIn( "scripts/verify_serviceification_d1_metadata_authority.py", PRODUCER_CLOSURE_PATHS, ) def test_deployment_does_not_requalify_a_signed_resolved_bom(self) -> None: source = ( REPO_ROOT / "scripts/verify_serviceification_d1_metadata_authority.py" ).read_text() self.assertNotIn("require_deployable", source) self.assertIn("require_desired=True", source) if __name__ == "__main__": unittest.main()