From cb0c1507de0bf54240f1f08d70cdf0be31b86dc1 Mon Sep 17 00:00:00 2001 From: Dom <168790843+firestar5683@users.noreply.github.com> Date: Sat, 31 Oct 2026 15:48:59 -0500 Subject: [PATCH] test: complete default metadata lookup in remaining preference fixtures Delegate the isolated Ioniq5PE, Toyota shell and GM pitch mock default lookups to real Params metadata. Preserve existing assertions, no-setting-write checks and runtime behavior. --- .../car/hyundai/tests/test_ioniq5pe_pending_startup.py | 4 ++++ .../starpilot/car/toyota/tests/test_radar_shell_authority.py | 4 ++++ openpilot/starpilot/tests/test_gm_pitch_preferences.py | 4 +++- prebuilt.json | 2 +- 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/opendbc_repo/opendbc/car/hyundai/tests/test_ioniq5pe_pending_startup.py b/opendbc_repo/opendbc/car/hyundai/tests/test_ioniq5pe_pending_startup.py index 0e86fc7222..c54b8639c3 100644 --- a/opendbc_repo/opendbc/car/hyundai/tests/test_ioniq5pe_pending_startup.py +++ b/opendbc_repo/opendbc/car/hyundai/tests/test_ioniq5pe_pending_startup.py @@ -482,6 +482,7 @@ class TestPENormalSelection(unittest.TestCase): from opendbc.car.car_helpers import get_car from opendbc.car.vin import VIN_UNKNOWN from opendbc.car.hyundai.tests.test_ioniq5pe_2027 import FIXTURE, firmware + from openpilot.common.params import Params from openpilot.selfdrive.car.card import alpha_long_requested from openpilot.starpilot.vehicle_preferences import VehicleStartupPreferences from openpilot.starpilot.vehicle_startup import VehicleStartupOwner @@ -499,6 +500,9 @@ class TestPENormalSelection(unittest.TestCase): for key, value in self.values.items(): (self.root / key).write_bytes(value) + def get_default_value(self, key): + return Params().get_default_value(key) + def get_param_path(self, key): return str(self.root / key) diff --git a/openpilot/starpilot/car/toyota/tests/test_radar_shell_authority.py b/openpilot/starpilot/car/toyota/tests/test_radar_shell_authority.py index d155023d02..ef8be96ecf 100644 --- a/openpilot/starpilot/car/toyota/tests/test_radar_shell_authority.py +++ b/openpilot/starpilot/car/toyota/tests/test_radar_shell_authority.py @@ -8,6 +8,7 @@ from opendbc.car import gen_empty_fingerprint from opendbc.car.toyota.interface import CarInterface, toyota_auto_hold_supported from opendbc.car.toyota.radar_interface import RadarInterface from opendbc.car.toyota.values import CAR +from openpilot.common.params import Params from openpilot.starpilot.ui import runtime_app from openpilot.starpilot.ui.feature_settings_owner import FeatureSettingsOwner from openpilot.starpilot.ui.feature_settings_state import FeaturePage, row_change @@ -18,6 +19,9 @@ class FilesystemParams: def __init__(self, path): self.path = path + def get_default_value(self, key): + return Params().get_default_value(key) + def get_param_path(self, key): return str(self.path / key) diff --git a/openpilot/starpilot/tests/test_gm_pitch_preferences.py b/openpilot/starpilot/tests/test_gm_pitch_preferences.py index 17024f78d1..8f0c249c31 100644 --- a/openpilot/starpilot/tests/test_gm_pitch_preferences.py +++ b/openpilot/starpilot/tests/test_gm_pitch_preferences.py @@ -7,13 +7,15 @@ import unittest from opendbc.car.gm.tests.test_ascm_intercept import params from opendbc.car import structs from opendbc.car.gm.values import CAR, PEDAL_BOLT_CAR +from openpilot.common.params import Params from openpilot.starpilot.vehicle_preferences import VehicleStartupPreferences class TestGMPitchPreferences(unittest.TestCase): def test_exact_off_and_default_on(self): with tempfile.TemporaryDirectory() as root: - source = SimpleNamespace(get_param_path=lambda key: str(Path(root) / key)) + source = SimpleNamespace(get_param_path=lambda key: str(Path(root) / key), + get_default_value=Params().get_default_value) for raw in (None, b'0', b'1', b'', b'false', b'0\n', b'0' * 20): path = Path(root) / 'LongPitch' path.unlink(missing_ok=True) diff --git a/prebuilt.json b/prebuilt.json index 4ff45fdd7b..0a824dc062 100644 --- a/prebuilt.json +++ b/prebuilt.json @@ -1 +1 @@ -{"protected_inventory_sha256": "1d1ba61d19622cec24db89557681495ff4c3743205d975e95c8a12607e592957", "schema_version": 1} +{"protected_inventory_sha256": "40521b42a0a738ed0346b641a0419b8e172f0760fd6889f3f7974318775933ca", "schema_version": 1}