diff --git a/tests/test_execution_snapshot_integrity.py b/tests/test_execution_snapshot_integrity.py index 82128ec..4e4def9 100644 --- a/tests/test_execution_snapshot_integrity.py +++ b/tests/test_execution_snapshot_integrity.py @@ -64,6 +64,9 @@ class _Session: def query(self, _model): return _Query(self.jobs) + def get(self, _model, _identifier): + return SimpleNamespace(id="campaign-1") + def _snapshotted_version(job: SimpleNamespace): version = SimpleNamespace( @@ -87,9 +90,15 @@ def _snapshotted_version(job: SimpleNamespace): def _ensure(session: _Session, version) -> None: - with patch( - "govoplan_campaign.backend.sending.execution.files_integration", - return_value=SimpleNamespace(available=False), + with ( + patch( + "govoplan_campaign.backend.sending.execution.files_integration", + return_value=SimpleNamespace(available=False), + ), + patch( + "govoplan_campaign.backend.sending.execution.assert_archive_encryption_allowed", + return_value=SimpleNamespace(policy_hash="archive-policy"), + ), ): ensure_execution_snapshot(session, version) # type: ignore[arg-type] @@ -125,12 +134,19 @@ def test_effect_check_verifies_only_the_claimed_job_in_constant_time() -> None: job = _job() version = _snapshotted_version(job) session = SimpleNamespace( - query=lambda *_args: pytest.fail("per-effect validation must not rescan every campaign job") + query=lambda *_args: pytest.fail("per-effect validation must not rescan every campaign job"), + get=lambda *_args: SimpleNamespace(id="campaign-1"), ) - with patch( - "govoplan_campaign.backend.sending.execution.files_integration", - return_value=SimpleNamespace(available=False), + with ( + patch( + "govoplan_campaign.backend.sending.execution.files_integration", + return_value=SimpleNamespace(available=False), + ), + patch( + "govoplan_campaign.backend.sending.execution.assert_archive_encryption_allowed", + return_value=SimpleNamespace(policy_hash="archive-policy"), + ), ): ensure_execution_snapshot( session, # type: ignore[arg-type] diff --git a/tests/test_route_registration.py b/tests/test_route_registration.py index 2deb500..8c1262a 100644 --- a/tests/test_route_registration.py +++ b/tests/test_route_registration.py @@ -42,7 +42,7 @@ def test_campaign_router_composes_every_workflow_operation_once() -> None: actual = _operation_keys(router) assert actual == expected - assert len(actual) == 80 + assert len(actual) == 81 assert not [operation for operation, count in Counter(actual).items() if count > 1]