Fix static CI contracts without changing runtime behavior

This commit is contained in:
Dom
2026-11-11 13:26:36 -06:00
parent e76c6937d4
commit dc60049a25
4 changed files with 12 additions and 8 deletions
@@ -10,7 +10,8 @@ from openpilot.starpilot.speed_limits.vision import model
@unittest.skipIf(model.cv2 is None, 'OpenCV is optional')
class TestMaterialValidation(unittest.TestCase):
def validate(self, image):
return model.VisionModelCore._is_regulatory_speed_sign(None, image)
core = model.VisionModelCore.__new__(model.VisionModelCore)
return core._is_regulatory_speed_sign(image)
def panel(self, hue=None):
hsv = np.zeros((100, 80, 3), np.uint8)
@@ -1163,9 +1163,9 @@ class FeatureSettingsOwner:
reason="Off uses the upstream planner. Supported longitudinal control stays active. Changes apply on the next drive."))
allowed = configurable and system_long
force_enabled, _, _ = self._value("ForceStops")
rows.append(self._bool_row("ForceStops", "Enhanced Stops", allowed or
(force_enabled == "1" and self.authority("preferences")),
reason="Improves stopping behavior at traffic lights and enables automatic stopping at detected stop signs. Press the accelerator to continue."))
rows.append(self._bool_row(
"ForceStops", "Enhanced Stops", allowed or (force_enabled == "1" and self.authority("preferences")),
reason="Improves stopping behavior at traffic lights and enables automatic stopping at detected stop signs. Press the accelerator to continue."))
offset_row = self._number_row("ForceStopDistanceOffset", "Stop Distance Adjustment", allowed and force_enabled == "1")
rows.append(replace(offset_row, default_reset_available=allowed and parked and offset_row.step > 0,
reason="Positive values stop farther forward; negative values stop earlier"))
@@ -62,12 +62,15 @@ class TestRenderDocumentReuse(unittest.TestCase):
self.assertEqual(set(selected), {key})
self.assertEqual(selected[key], all_actions[key])
allowed[0] = False
if selected[key].invoke is not None:
self.assertFalse(selected[key].invoke())
invoke = selected[key].invoke
if invoke is not None:
self.assertFalse(invoke())
allowed[0] = True
saved = favorites.layout_actions(params, profile, lambda: True, requested_keys={'EnableTorqueBarWidget'})
path.write_bytes(self.raw + b' ')
self.assertFalse(saved['EnableTorqueBarWidget'].invoke())
invoke = saved['EnableTorqueBarWidget'].invoke
assert invoke is not None
self.assertFalse(invoke())
path.write_bytes(self.raw)
def test_unrequested_layout_actions_do_not_read_saved_layout(self):
+1 -1
View File
@@ -1 +1 @@
{"protected_inventory_sha256": "ea6f3896400d5a3122229c676eabb3cfd5c929756d62bf4a824fe969ccea9fac", "schema_version": 1}
{"protected_inventory_sha256": "00fcb8440a365c107104fea6a9518c9d933cf3d71ba04e1a44eeed26e284f3ec", "schema_version": 1}