mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-02-27 13:03:52 +08:00
Hyundai: add CAN FD feature test (#27834)
* rename two can-specific feature lists * the other lists don't say CAN_ * like to be safe
This commit is contained in:
@@ -2,13 +2,18 @@
|
||||
import unittest
|
||||
|
||||
from cereal import car
|
||||
from selfdrive.car.hyundai.values import CANFD_CAR, FW_QUERY_CONFIG, FW_VERSIONS
|
||||
from selfdrive.car.hyundai.values import CANFD_CAR, FW_QUERY_CONFIG, FW_VERSIONS, CAN_GEARS, LEGACY_SAFETY_MODE_CAR, CHECKSUM, CAMERA_SCC_CAR
|
||||
|
||||
Ecu = car.CarParams.Ecu
|
||||
ECU_NAME = {v: k for k, v in Ecu.schema.enumerants.items()}
|
||||
|
||||
|
||||
class TestHyundaiFingerprint(unittest.TestCase):
|
||||
def test_canfd_not_in_can_features(self):
|
||||
can_specific_feature_list = set.union(*CAN_GEARS.values(), *CHECKSUM.values(), LEGACY_SAFETY_MODE_CAR, CAMERA_SCC_CAR)
|
||||
for car_model in CANFD_CAR:
|
||||
self.assertNotIn(car_model, can_specific_feature_list, "CAN FD car unexpectedly found in a CAN feature list")
|
||||
|
||||
def test_auxiliary_request_ecu_whitelist(self):
|
||||
# Asserts only auxiliary Ecus can exist in database for CAN-FD cars
|
||||
whitelisted_ecus = {ecu for r in FW_QUERY_CONFIG.requests for ecu in r.whitelist_ecus if r.auxiliary}
|
||||
|
||||
Reference in New Issue
Block a user