mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-16 23:02:07 +08:00
Car docs: test for missing harnesses (#25444)
* All cars must have a harness * except body * skip test * Q for IoniQ old-commit-hash: 574021a0acd7f632b902efe858a22cb7b66b67e6
This commit is contained in:
@@ -92,8 +92,6 @@ class CarInfo:
|
||||
else:
|
||||
self.min_steer_speed = CP.minSteerSpeed
|
||||
|
||||
assert self.harness is not None, f"{CP.carFingerprint}: Need to specify car harness"
|
||||
|
||||
# TODO: set all the min enable speeds in carParams correctly and remove this
|
||||
if self.min_enable_speed is None:
|
||||
self.min_enable_speed = CP.minEnableSpeed
|
||||
@@ -212,6 +210,7 @@ class Harness(Enum):
|
||||
hyundai_n = "Hyundai N"
|
||||
hyundai_o = "Hyundai O"
|
||||
hyundai_p = "Hyundai P"
|
||||
hyundai_q = "Hyundai Q"
|
||||
custom = "Developer"
|
||||
obd_ii = "OBD-II"
|
||||
gm = "GM"
|
||||
|
||||
@@ -127,7 +127,7 @@ CAR_INFO: Dict[str, Optional[Union[HyundaiCarInfo, List[HyundaiCarInfo]]]] = {
|
||||
],
|
||||
CAR.VELOSTER: HyundaiCarInfo("Hyundai Veloster 2019-20", "Smart Cruise Control (SCC)", min_enable_speed=5. * CV.MPH_TO_MS, harness=Harness.hyundai_e),
|
||||
CAR.SONATA_HYBRID: HyundaiCarInfo("Hyundai Sonata Hybrid 2020-22", "All", harness=Harness.hyundai_a),
|
||||
CAR.IONIQ_5: HyundaiCarInfo("Hyundai Ioniq 5 2022", "Highway Driving Assist II", harness=Harness.none),
|
||||
CAR.IONIQ_5: HyundaiCarInfo("Hyundai Ioniq 5 2022", "Highway Driving Assist II", harness=Harness.hyundai_q),
|
||||
|
||||
# Kia
|
||||
CAR.KIA_FORTE: [
|
||||
|
||||
@@ -4,7 +4,7 @@ import unittest
|
||||
|
||||
from selfdrive.car.car_helpers import interfaces, get_interface_attr
|
||||
from selfdrive.car.docs import CARS_MD_OUT, CARS_MD_TEMPLATE, generate_cars_md, get_all_car_info
|
||||
from selfdrive.car.docs_definitions import Column, Star
|
||||
from selfdrive.car.docs_definitions import Column, Harness, Star
|
||||
from selfdrive.car.honda.values import CAR as HONDA
|
||||
|
||||
|
||||
@@ -56,6 +56,14 @@ class TestCarDocs(unittest.TestCase):
|
||||
with self.subTest(car=car):
|
||||
self.assertIsNone(re.search(r"\d{4}-\d{4}", car.name), f"Format years correctly: {car.name}")
|
||||
|
||||
def test_harnesses(self):
|
||||
for car in self.all_cars:
|
||||
with self.subTest(car=car):
|
||||
if car.name == "comma body":
|
||||
raise unittest.SkipTest
|
||||
|
||||
self.assertNotIn(car.harness, [None, Harness.none], f"Need to specify car harness: {car.name}")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
||||
Reference in New Issue
Block a user