From fff5278ca2fc3c48be2e5745f7f229c71f967050 Mon Sep 17 00:00:00 2001 From: firestar5683 <168790843+firestar5683@users.noreply.github.com> Date: Wed, 11 Nov 2026 15:37:50 -0600 Subject: [PATCH] Clarify shared test helper types and require sign bounds --- .../speed_limits/vision/tests/test_terminal_material_false.py | 4 ++-- openpilot/starpilot/ui/tests/test_compact_sign_height.py | 1 + prebuilt.json | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/openpilot/starpilot/speed_limits/vision/tests/test_terminal_material_false.py b/openpilot/starpilot/speed_limits/vision/tests/test_terminal_material_false.py index 84cbb7628b..3ce87fe175 100644 --- a/openpilot/starpilot/speed_limits/vision/tests/test_terminal_material_false.py +++ b/openpilot/starpilot/speed_limits/vision/tests/test_terminal_material_false.py @@ -46,7 +46,7 @@ class Head: @unittest.skipIf(model.cv2 is None, 'OpenCV is optional') class TestTerminalMaterialFalse(unittest.TestCase): - def setup_case(self, *, proposals=None, control=False, face_type=speed_face.SpeedFaceVerifier): + def setup_case(self: unittest.TestCase, *, proposals=None, control=False, face_type=speed_face.SpeedFaceVerifier): core = object.__new__(model.VisionModelCore) core.latest_detector_proposal = None core.temporal_tracking_enabled = True @@ -68,7 +68,7 @@ class TestTerminalMaterialFalse(unittest.TestCase): frame = np.zeros((1100, 2000, 3), np.uint8) return core, face, proposals, frame - def run_case(self, case): + def run_case(self: unittest.TestCase, case): core, _, proposals, frame = case with patch.object(core, '_collect_detector_classifier_proposals', return_value=proposals): result = core._detect_sign_from_detector_classifier(frame) diff --git a/openpilot/starpilot/ui/tests/test_compact_sign_height.py b/openpilot/starpilot/ui/tests/test_compact_sign_height.py index 9ba915b715..c6bda4a182 100644 --- a/openpilot/starpilot/ui/tests/test_compact_sign_height.py +++ b/openpilot/starpilot/ui/tests/test_compact_sign_height.py @@ -179,6 +179,7 @@ def test_mutcd_preserves_text_sizes_and_fits_both_sizes_with_real_fonts(profile) assert boxes[-1][3] <= cy + half_height - 1 assert all(a[3] + 4 * widget.scale <= b[1] for a, b in zip(boxes, boxes[1:], strict=False)) bounds = speed_limit_bounds(profile, current) + assert bounds is not None outer_width, outer_height = (SIGN_WIDTH / 2 - 2) * .9 * scale + scale, (SIGN_HEIGHT / 2 - 2) * scale + scale assert bounds[0] <= cx - outer_width and cx + outer_width <= bounds[2] assert bounds[1] <= cy - outer_height and cy + outer_height <= bounds[3] diff --git a/prebuilt.json b/prebuilt.json index f6fa51b928..425ee7b245 100644 --- a/prebuilt.json +++ b/prebuilt.json @@ -1 +1 @@ -{"protected_inventory_sha256": "565be1e4c8d41d8a8c2b1d8d51e94c60fc784d0607da7c6e02132780043fea44", "schema_version": 1} +{"protected_inventory_sha256": "2dee191344d0a49e034a14f0aae85705b5254d163cf29a4f88c2558af15b4c6b", "schema_version": 1}