Clarify shared test helper types and require sign bounds

This commit is contained in:
firestar5683
2026-11-11 15:37:50 -06:00
parent 39ef918cbb
commit fff5278ca2
3 changed files with 4 additions and 3 deletions
@@ -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)
@@ -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]
+1 -1
View File
@@ -1 +1 @@
{"protected_inventory_sha256": "565be1e4c8d41d8a8c2b1d8d51e94c60fc784d0607da7c6e02132780043fea44", "schema_version": 1}
{"protected_inventory_sha256": "2dee191344d0a49e034a14f0aae85705b5254d163cf29a4f88c2558af15b4c6b", "schema_version": 1}