diff --git a/openpilot/selfdrive/controls/tests/test_conditional_runtime_loop.py b/openpilot/selfdrive/controls/tests/test_conditional_runtime_loop.py index 6ca2b91b8b..48c6fbe13e 100644 --- a/openpilot/selfdrive/controls/tests/test_conditional_runtime_loop.py +++ b/openpilot/selfdrive/controls/tests/test_conditional_runtime_loop.py @@ -10,6 +10,7 @@ from unittest.mock import Mock, call, patch from opendbc.car.honda.interface import CarInterface from opendbc.car.honda.values import CAR +from openpilot.starpilot.audio.departure_alert import DepartureNotifications from openpilot.cereal import messaging from openpilot.common.params import Params from openpilot.selfdrive.controls.lib.longitudinal_planner import LongitudinalPlanner @@ -151,6 +152,8 @@ class TestConditionalRuntimeLoop(unittest.TestCase): settings = {'CONDITIONAL_MODE_REPLAY_RUNTIME': '0', 'SLC_REPLAY_RUNTIME': '0', 'CURVE_REPLAY_RUNTIME': '0', 'LONG_PLANNER_REPLAY_RUNTIME': '0'} with patch.dict(os.environ, settings, clear=True), patch.object(plannerd, 'Params', return_value=params), \ + patch('openpilot.starpilot.audio.departure_alert.DepartureNotifications', + side_effect=lambda: DepartureNotifications(params)), \ patch.object(plannerd, 'config_realtime_process'), \ patch.object(plannerd, 'ConditionalPlannerHost', wraps=ConditionalPlannerHost) as conditional_ctor, \ patch.object(messaging, 'PubMaster') as publisher, \ @@ -242,6 +245,8 @@ class TestConditionalRuntimeLoop(unittest.TestCase): sm = Mock() sm.update.side_effect = EndLoop with patch.dict(os.environ, {}, clear=True), patch.object(plannerd, 'Params', return_value=params), \ + patch('openpilot.starpilot.audio.departure_alert.DepartureNotifications', + side_effect=lambda: DepartureNotifications(params)), \ patch.object(plannerd, 'config_realtime_process'), \ patch.object(messaging, 'PubMaster') as publisher, \ patch.object(messaging, 'SubMaster', return_value=sm) as subscriber, patch.object(messaging, 'sub_sock'): diff --git a/openpilot/starpilot/longitudinal/tests/test_profile_runtime.py b/openpilot/starpilot/longitudinal/tests/test_profile_runtime.py index 927139b5e0..b57fc0405c 100644 --- a/openpilot/starpilot/longitudinal/tests/test_profile_runtime.py +++ b/openpilot/starpilot/longitudinal/tests/test_profile_runtime.py @@ -7,6 +7,7 @@ import unittest from pathlib import Path from unittest import mock +from openpilot.starpilot.audio.departure_alert import DepartureNotifications from openpilot.cereal import log from openpilot.common.params import Params from openpilot.selfdrive.controls.lib.longitudinal_planner import LongitudinalPlanner @@ -506,6 +507,8 @@ class ProfileRuntimeTests(unittest.TestCase): publisher = Publisher() environment = {} # Normal admission follows the actual saved request. with (mock.patch.object(plannerd, 'Params', return_value=self.params), + mock.patch('openpilot.starpilot.audio.departure_alert.DepartureNotifications', + side_effect=lambda: DepartureNotifications(self.params)), mock.patch.object(plannerd, 'config_realtime_process'), mock.patch.object(plannerd, 'LeadApproachPreferences', return_value=None), mock.patch.object(plannerd.messaging, 'SubMaster', return_value=sm), diff --git a/openpilot/starpilot/system/starport/tests/test_projection_onroad_boundary.py b/openpilot/starpilot/system/starport/tests/test_projection_onroad_boundary.py index 265b95046f..ba33fe3fce 100644 --- a/openpilot/starpilot/system/starport/tests/test_projection_onroad_boundary.py +++ b/openpilot/starpilot/system/starport/tests/test_projection_onroad_boundary.py @@ -110,7 +110,7 @@ class TestProjectionOnroad(unittest.TestCase): from openpilot.starpilot.ui.onroad_customization import default_document native, _ = self.dependencies() owner = Mock() - owner.read.return_value = {'revision': 'r1', 'enabled': True, 'token': 't', 'destination': None, + owner.read_routing.return_value = {'revision': 'r1', 'enabled': True, 'token': 't', 'destination': None, 'favorites': [{'id': 'h', 'label': 'home'}, {'id': 'w', 'label': 'work'}]} native.favorites = lambda authorized: ProjectionFavorites(authorized, owner) track = track or {'status': 'playing', 'title': 'Song', 'artist': 'Artist', 'shuffle': False, 'repeat': 'off', 'source': 'spotify'} diff --git a/openpilot/starpilot/tests/test_gm_feature_runtime.py b/openpilot/starpilot/tests/test_gm_feature_runtime.py index d4e8c23ac1..247a9645a2 100644 --- a/openpilot/starpilot/tests/test_gm_feature_runtime.py +++ b/openpilot/starpilot/tests/test_gm_feature_runtime.py @@ -8,6 +8,7 @@ from opendbc.car.gm.feature_capabilities import display_supported, longitudinal_ from opendbc.car.gm.interface import CarInterface from opendbc.car.gm.values import CAR from opendbc.car.gm.tests.test_camera_acc_pedal import CAMERA_IDS, fingerprint as camera_pedal_fingerprint +from openpilot.starpilot.audio.departure_alert import DepartureNotifications from openpilot.common.params import Params from openpilot.common.prefix import OpenpilotPrefix from openpilot.starpilot.speed_limits import planner_host as slc_host @@ -217,6 +218,8 @@ class TestGmFeatureRuntime(unittest.TestCase): sm = Mock() sm.update.side_effect = EndLoop with (patch.object(plannerd, 'Params', return_value=params), + patch('openpilot.starpilot.audio.departure_alert.DepartureNotifications', + side_effect=lambda: DepartureNotifications(params)), patch.object(plannerd, 'config_realtime_process'), patch.object(plannerd, 'ConditionalPlannerHost', wraps=plannerd.ConditionalPlannerHost) as conditional, patch.object(plannerd, 'CurvePreferenceHost', wraps=plannerd.CurvePreferenceHost) as curve, diff --git a/openpilot/starpilot/tests/test_gm_vision_source.py b/openpilot/starpilot/tests/test_gm_vision_source.py index f939882936..8409b5efd4 100644 --- a/openpilot/starpilot/tests/test_gm_vision_source.py +++ b/openpilot/starpilot/tests/test_gm_vision_source.py @@ -3,6 +3,7 @@ from pathlib import Path import unittest from unittest.mock import Mock, patch +from openpilot.starpilot.audio.departure_alert import DepartureNotifications from openpilot.cereal import messaging from openpilot.common.params import Params from openpilot.common.prefix import OpenpilotPrefix @@ -192,6 +193,8 @@ class TestGmVisionSource(unittest.TestCase): sm = Mock() sm.update.side_effect = EndLoop with (patch.object(plannerd, 'Params', return_value=params), + patch('openpilot.starpilot.audio.departure_alert.DepartureNotifications', + side_effect=lambda: DepartureNotifications(params)), patch.object(plannerd, 'config_realtime_process'), patch.object(slc_host, 'SlcRuntime', wraps=slc_host.SlcRuntime) as runtime, patch.object(plannerd.messaging, 'sub_sock'), diff --git a/prebuilt.json b/prebuilt.json index bdf4391fa9..a6c84771c9 100644 --- a/prebuilt.json +++ b/prebuilt.json @@ -1 +1 @@ -{"protected_inventory_sha256": "cd323096762ecce1992eff7643310a22f3fee8eaec57e902f09b91b7ae43a0f1", "schema_version": 1} +{"protected_inventory_sha256": "48cb38a2d162a325d60e55057f6c85ad2ad2bb17fad980c2f0489294d26a3fea", "schema_version": 1}