mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-11-08 13:33:42 +08:00
Align vision and Sierra CI fixtures with existing contracts
This commit is contained in:
@@ -102,6 +102,7 @@ class TestCarDocs(unittest.TestCase):
|
||||
self.assertEqual(doc.support_type, SupportType.COMMUNITY)
|
||||
self.assertFalse(doc.merged)
|
||||
expected_harness = (CarHarness.gm if platform == GM.CHEVROLET_BOLT_ACC_2022_2023 else
|
||||
CarHarness.custom if platform == GM.CHEVROLET_SILVERADO_CC else
|
||||
CarHarness.custom if "ASCM Harness" in doc.name or "(CC)" in doc.name else
|
||||
CarHarness.gmsdgm if "SDGM Harness" in doc.name else
|
||||
CarHarness.gm if "Camera Harness" in doc.name else CarHarness.obd_ii)
|
||||
|
||||
@@ -204,13 +204,15 @@ def test_honda_slc_controls_only_with_openpilot_long():
|
||||
|
||||
|
||||
def test_vision_stop_request_is_independent_of_speed_and_preserves_native_authority():
|
||||
from openpilot.common.params import Params
|
||||
from openpilot.system.manager.process_config import vision_slc_development
|
||||
from unittest.mock import patch
|
||||
with TemporaryDirectory() as temporary, patch.dict('os.environ', {}, clear=True):
|
||||
params = Files(Path(temporary))
|
||||
params = Params(temporary)
|
||||
root = Path(params.get_param_path())
|
||||
for key, value in {'SpeedLimitController': b'0', 'ShowSpeedLimits': b'0',
|
||||
'SLCPriority1': b'Dashboard', 'SLCPriority2': b'Map Data', 'ForceStops': b'1'}.items():
|
||||
(params.root / key).write_bytes(value)
|
||||
(root / key).write_bytes(value)
|
||||
assert not requested(params, 'slc')
|
||||
assert not requested(params, 'vision')
|
||||
assert requested(params, 'vision_stop')
|
||||
@@ -220,16 +222,16 @@ def test_vision_stop_request_is_independent_of_speed_and_preserves_native_author
|
||||
for cp in (stock_cp(), None, object()):
|
||||
assert not enabled(params, cp, 'vision_stop', {})
|
||||
assert not vision_slc_development(True, params, cp)
|
||||
(params.root / 'SpeedLimitController').write_bytes(b'broken')
|
||||
(root / 'SpeedLimitController').write_bytes(b'broken')
|
||||
assert requested(params, 'vision_stop')
|
||||
assert vision_slc_development(True, params, long_cp())
|
||||
for key, value in (('ForceStops', b'0'), ('ForceStops', b'true'), ('ForceStops', b'1'),
|
||||
('SafeMode', b'1'), ('SafeMode', b'corrupt')):
|
||||
(params.root / key).write_bytes(value)
|
||||
(root / key).write_bytes(value)
|
||||
if (key, value) != ('ForceStops', b'1'):
|
||||
assert not enabled(params, long_cp(), 'vision_stop', {})
|
||||
(params.root / 'SafeMode').write_bytes(b'0')
|
||||
(root / 'SafeMode').write_bytes(b'0')
|
||||
assert enabled(params, long_cp(), 'vision_stop', {})
|
||||
(params.root / 'ForceStops').unlink()
|
||||
(params.root / 'ForceStops').mkdir()
|
||||
(root / 'ForceStops').unlink()
|
||||
(root / 'ForceStops').mkdir()
|
||||
assert not requested(params, 'vision_stop')
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
{"protected_inventory_sha256": "d76237142250adfff614ffef924e9542e9d77e5204e5b8ff066ff630b4edeb64", "schema_version": 1}
|
||||
{"protected_inventory_sha256": "89fe66f020c64d8c9b782b0bd8948438a69ff4ac9b10bd18036c4c5c88b8826e", "schema_version": 1}
|
||||
|
||||
Reference in New Issue
Block a user