From 7bd5144238c5b936ffbe6c36c949a7d7aa4882f7 Mon Sep 17 00:00:00 2001 From: ai-bot Date: Sun, 4 Oct 2026 16:29:22 +0000 Subject: [PATCH] Compare the merged alert codes without depending on their order --- tests/test_alerts.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/test_alerts.py b/tests/test_alerts.py index 9af79f7..25ee21a 100644 --- a/tests/test_alerts.py +++ b/tests/test_alerts.py @@ -139,7 +139,8 @@ class AlertTests(unittest.TestCase): def test_a_mismatch_is_not_merged_with_a_real_unavailable_alert(self): # The mismatch has its own code, so the two are never merged even though - # they share a source (section 25.1). + # they share a source (section 25.1). Both are critical and come from + # checks with the same date, so the newest check is listed first. mismatch = dated_record(1, "2026-10-01") mismatch["key_checks"][0]["address_path_verified"] = "PROBLEM" unavailable = dated_record(2, "2026-10-01") @@ -148,7 +149,7 @@ class AlertTests(unittest.TestCase): alerts = collect_alerts([mismatch, unavailable]) self.assertEqual( - [alert["code"] for alert in alerts], + sorted(alert["code"] for alert in alerts), ["address_path_mismatch", "key_unavailable"], ) self.assertEqual({alert["source"] for alert in alerts}, {"Key 1: SeedSigner"})