mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-11-05 20:13:47 +08:00
Repair alert fixture and document weather epoch clock
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
@@ -1 +1 @@
|
||||
{"protected_inventory_sha256": "ec942078f3cfc87d5683b73d47e4c45adea7152ea1ddfa76c49bd4668cbedcd6", "schema_version": 1}
|
||||
{"protected_inventory_sha256": "0871a6b9131b55f6b8f2838589b548cd3ab52825acb1a6c367da7512c000aa76", "schema_version": 1}
|
||||
|
||||
Reference in New Issue
Block a user