diff options
| author | Mohamed Hegazy <mhegazy@anthropic.com> | 2026-10-20 22:43:59 +0000 |
|---|---|---|
| committer | Claude <noreply@anthropic.com> | 2026-10-20 22:43:59 +0000 |
| commit | b541fcab7df839cf90de95fdc0c039cb83544a95 (patch) | |
| tree | f5b9a00499fc9985db4bd2a7ece2670822504ae2 /plugins/security-guidance/tests | |
| parent | 6a331ec8ced0a1ae66dbb927e9909bc37acb26c3 (diff) | |
security-guidance: test the mask order, not that the masks come lastmhegazy/sg-pattern-fired-telemetry
Other tail metrics are now added after the two warning masks, so the
masks are no longer the last keys on the Stop row. What matters is that
the fired mask comes after the unresolved one, so a row cut at the key
cap loses the fired mask first. Test that, and say so in the comment.
Diffstat (limited to 'plugins/security-guidance/tests')
| -rw-r--r-- | plugins/security-guidance/tests/test_pattern_fired_metrics.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/plugins/security-guidance/tests/test_pattern_fired_metrics.py b/plugins/security-guidance/tests/test_pattern_fired_metrics.py index 256cbf73..c1e31300 100644 --- a/plugins/security-guidance/tests/test_pattern_fired_metrics.py +++ b/plugins/security-guidance/tests/test_pattern_fired_metrics.py @@ -34,13 +34,14 @@ class TestFiredRulesReachTheStopRow: assert m["warn_unresolved_mask"] == EVAL assert list(m).index("warn_fired_mask") < 20 - def test_fired_mask_is_the_last_key(self, env, gateway, workspace): + def test_fired_mask_follows_the_unresolved_mask(self, env, gateway, workspace): """A row cut at the key cap loses the fired mask before the unresolved one.""" _, repo = workspace gateway.vulns = [STUB_VULN] m = _turn(repo, env, {"calc.js": "const v = eval(src)\n"}) - assert list(m)[-2:] == ["warn_unresolved_mask", "warn_fired_mask"] + keys = list(m) + assert keys.index("warn_unresolved_mask") < keys.index("warn_fired_mask") assert m["warn_fixed"] == 0 and m["warn_unresolved"] == 1 def test_review_with_findings(self, env, gateway, workspace): |
