From c542eccc0825c89d30489baf690ac820ab29fe85 Mon Sep 17 00:00:00 2001 From: Sam Gu <127461594+SamGu-NRX@users.noreply.github.com> Date: Sat, 17 Oct 2026 22:14:26 +0000 Subject: [PATCH] test(verification): pin unverified-override warning for corner allowance The unverified-override warning (public_assumption_warnings) covers every assumed key, but only battery_width had a test. Parametrize the existing case-matches-public test over corner_allowance too, so a non-public response that reports neither value keeps both warnings. --- verification/tests/test_reported_rules.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/verification/tests/test_reported_rules.py b/verification/tests/test_reported_rules.py index 64442f0e2..16f307ff8 100644 --- a/verification/tests/test_reported_rules.py +++ b/verification/tests/test_reported_rules.py @@ -28,14 +28,22 @@ def test_public_fingerprint_matches_recorded_public_solver(): assert RULES.rules_sha256 == fixture["result"]["policy"]["rules_sha256"] +@pytest.mark.parametrize( + "assumed", + [ + {"battery_width": RULES.width_ft}, + {"corner_allowance": RULES.corner_allowance_ft}, + ], + ids=["battery_width", "corner_allowance"], +) @pytest.mark.parametrize("identity", ["private source", "different fingerprint"]) -def test_unreported_override_is_unverified_even_when_case_matches_public(identity): +def test_unreported_override_is_unverified_even_when_case_matches_public(assumed, identity): answer = {"policy": {"sources": ["public"], "rules_sha256": RULES.rules_sha256}} if identity == "private source": answer["policy"]["sources"].append("private") else: answer["policy"]["rules_sha256"] = "f" * 64 - warnings = public_assumption_warnings({"battery_width": RULES.width_ft}, answer, RULES) + warnings = public_assumption_warnings(assumed, answer, RULES) assert len(warnings) == 1 assert "assumed public rules; server may override" in warnings[0]