Mirrored from https://github.com/davoodmehraban89/Aram.git
Synced Dec 3, 22:00 UTC
test(desktop): reject malformed policy hashes and unexplained blocked status
davoodmehraban89 committed
Oct 31, 2026 at 21:54 UTC
b5b93213e65c02c514180cece8936874577e9954
1 file changed
+22
backend/tests/test_desktop_five_statement_details.py
+22
@@ -174,3 +174,25 @@ def test_persian_zero_width_non_joiner_is_preserved_in_detail_label():
174
)
175
rows = build_preview_details(changed)
176
assert any(row.item == label for row in rows)
177
+
178
+
179
+def test_integrity_gate_rejects_malformed_policy_digest():
180
+ result = build_pipeline()
181
+ changed = replace(
182
+ result, income_statement=replace(
183
+ result.income_statement, presentation_policies_sha256="bad-digest",
184
+ ),
185
+ )
186
+ with pytest.raises(CoverageError, match="PROVENANCE_HASH"):
187
+ validate_desktop_pipeline_result(changed)
188
+
189
+
190
+def test_integrity_gate_rejects_blocked_state_without_explanation():
191
+ result = build_pipeline()
192
+ changed = replace(
193
+ result, reconciliation=replace(
194
+ result.reconciliation, eligible_for_analyst_review=False,
195
+ ),
196
+ )
197
+ with pytest.raises(CoverageError, match="BLOCKED_WITHOUT_FINDINGS"):
198
+ validate_desktop_pipeline_result(changed)