Validate Test Alert Types

This commit is contained in:
firestar5683
2026-11-28 16:10:50 -06:00
parent 303a5a4383
commit db93ad9414
3 changed files with 4 additions and 2 deletions
@@ -8,7 +8,7 @@ from unittest.mock import patch
import pytest
from openpilot.selfdrive.selfdrived.bookmarks import BookmarkCounter
from openpilot.selfdrive.selfdrived.events import ET, EVENTS, EventName, Events
from openpilot.selfdrive.selfdrived.events import Alert, ET, EVENTS, EventName, Events
from openpilot.cereal import messaging
@@ -56,6 +56,7 @@ def test_numbered_alert_preserves_native_style_and_pairing_subtitle(paired):
events.add(event)
alert, = events.create_alerts([ET.PERMANENT])
baseline = EVENTS[event][ET.PERMANENT]
assert isinstance(baseline, Alert)
assert alert.alert_text_1 == 'Bookmark #12 Saved'
assert alert.alert_text_2 == baseline.alert_text_2
for key in ('alert_size', 'alert_status', 'priority', 'visual_alert', 'audible_alert', 'duration'):
@@ -78,6 +78,7 @@ class TestLaneChangeAlert(unittest.TestCase):
def test_fresh_manual_keeps_stock_and_waiting_copy_does_not_mutate_template(self):
stock = EVENTS[EventName.preLaneChangeLeft][ET.WARNING]
assert isinstance(stock, Alert)
original = stock.alert_text_1
manual = LaneChangeStatus("session", 1, 77, 10_000_000_000, 1_000_000_000, 1_100_000_000,
Phase.MANUAL_REQUIRED, Direction.LEFT, False, True)
+1 -1
View File
@@ -1 +1 @@
{"protected_inventory_sha256": "81f6425f26ab3513da2684d0d9a9c726010d8b3dd0878f6fc7fcb2d0cd8a7e88", "schema_version": 1}
{"protected_inventory_sha256": "022e08440e83fcf0365cfec90b501426de27621edbba3ae9a00756266ed8fce9", "schema_version": 1}