Repair alert fixture and document weather epoch clock

This commit is contained in:
Dom
2026-10-31 21:06:07 -05:00
parent feb1f442c2
commit cd585f55c2
3 changed files with 4 additions and 3 deletions
@@ -5,6 +5,7 @@ from copy import copy
from unittest.mock import patch
import unittest
from opendbc.car.structs import car
from openpilot.cereal import log
from openpilot.starpilot.controllers.mode_actions import SwitchbackCooldown
from openpilot.selfdrive.selfdrived.alertmanager import AlertManager
@@ -36,7 +37,7 @@ class TestLaneChangeAlert(unittest.TestCase):
drive.events = Events()
drive.events.add(EventName.preLaneChangeLeft)
self.enterContext(patch.object(drive, "state_machine", SimpleNamespace(current_alert_types=[ET.WARNING], soft_disable_timer=0), create=True))
drive.CP = object()
drive.CP = car.CarParams.new_message()
drive.personality = next(iter(log.LongitudinalPersonality.schema.enumerants.values()))
drive.is_metric = False
drive.enabled = False
+1 -1
View File
@@ -13,7 +13,7 @@ from openpilot.starpilot.storage import starpilot_storage_root
class WeatherSource:
def __init__(self, position=None, *, fetch=None, clock=time.monotonic, wall=time.time):
def __init__(self, position=None, *, fetch=None, clock=time.monotonic, wall=time.time): # noqa: TID251 - Weather API timestamps are Unix time; retry intervals use monotonic.
self.position = position or LastPositionStore(starpilot_storage_root() / 'navigation')
self.fetch = fetch or self._fetch
self.clock, self.wall = clock, wall
+1 -1
View File
@@ -1 +1 @@
{"protected_inventory_sha256": "ec942078f3cfc87d5683b73d47e4c45adea7152ea1ddfa76c49bd4668cbedcd6", "schema_version": 1}
{"protected_inventory_sha256": "0871a6b9131b55f6b8f2838589b548cd3ab52825acb1a6c367da7512c000aa76", "schema_version": 1}