diff --git a/selfdrive/car/hyundai/tests/test_hyundai.py b/selfdrive/car/hyundai/tests/test_hyundai.py index f0c6b05c00..5fa92624af 100755 --- a/selfdrive/car/hyundai/tests/test_hyundai.py +++ b/selfdrive/car/hyundai/tests/test_hyundai.py @@ -62,7 +62,7 @@ class TestHyundaiFingerprint(unittest.TestCase): # Asserts no ECUs known to be shared across platforms exist in the database. # Tucson having Santa Cruz camera and EPS for example for car_model, ecus in FW_VERSIONS.items(): - with self.subTest(car_model=car_model): + with self.subTest(car_model=car_model.value): if car_model == CAR.SANTA_CRUZ_1ST_GEN: raise unittest.SkipTest("Skip checking Santa Cruz for its parts") @@ -79,7 +79,7 @@ class TestHyundaiFingerprint(unittest.TestCase): """ expected_fw_prefix = HYUNDAI_VERSION_REQUEST_LONG[1:] for car_model, ecus in FW_VERSIONS.items(): - with self.subTest(car_model=car_model): + with self.subTest(car_model=car_model.value): for ecu, fws in ecus.items(): # TODO: enable for Ecu.fwdRadar, Ecu.abs, Ecu.eps, Ecu.transmission if ecu[0] in (Ecu.fwdCamera,): @@ -103,7 +103,7 @@ class TestHyundaiFingerprint(unittest.TestCase): # Asserts ECU keys essential for fuzzy fingerprinting are available on all platforms for car_model, ecus in FW_VERSIONS.items(): - with self.subTest(car_model=car_model): + with self.subTest(car_model=car_model.value): for platform_code_ecu in PLATFORM_CODE_ECUS: if platform_code_ecu in (Ecu.fwdRadar, Ecu.eps) and car_model == CAR.HYUNDAI_GENESIS: continue @@ -118,7 +118,7 @@ class TestHyundaiFingerprint(unittest.TestCase): # - expected parsing of ECU FW dates for car_model, ecus in FW_VERSIONS.items(): - with self.subTest(car_model=car_model): + with self.subTest(car_model=car_model.value): for ecu, fws in ecus.items(): if ecu[0] not in PLATFORM_CODE_ECUS: continue diff --git a/selfdrive/car/tests/test_fw_fingerprint.py b/selfdrive/car/tests/test_fw_fingerprint.py index 378b68e43e..6777aeb738 100755 --- a/selfdrive/car/tests/test_fw_fingerprint.py +++ b/selfdrive/car/tests/test_fw_fingerprint.py @@ -97,7 +97,7 @@ class TestFwFingerprint(unittest.TestCase): def test_fw_version_lists(self): for car_model, ecus in FW_VERSIONS.items(): - with self.subTest(car_model=car_model): + with self.subTest(car_model=car_model.value): for ecu, ecu_fw in ecus.items(): with self.subTest(ecu): duplicates = {fw for fw in ecu_fw if ecu_fw.count(fw) > 1} @@ -119,13 +119,13 @@ class TestFwFingerprint(unittest.TestCase): for brand, config in FW_QUERY_CONFIGS.items(): for car_model, ecus in VERSIONS[brand].items(): bad_ecus = set(ecus).intersection(config.extra_ecus) - with self.subTest(car_model=car_model): + with self.subTest(car_model=car_model.value): self.assertFalse(len(bad_ecus), f'{car_model}: Fingerprints contain ECUs added for data collection: {bad_ecus}') def test_blacklisted_ecus(self): blacklisted_addrs = (0x7c4, 0x7d0) # includes A/C ecu and an unknown ecu for car_model, ecus in FW_VERSIONS.items(): - with self.subTest(car_model=car_model): + with self.subTest(car_model=car_model.value): CP = interfaces[car_model][0].get_non_essential_params(car_model) if CP.carName == 'subaru': for ecu in ecus.keys(): diff --git a/selfdrive/car/toyota/tests/test_toyota.py b/selfdrive/car/toyota/tests/test_toyota.py index 5241a95a99..cdaef55269 100755 --- a/selfdrive/car/toyota/tests/test_toyota.py +++ b/selfdrive/car/toyota/tests/test_toyota.py @@ -26,7 +26,7 @@ class TestToyotaInterfaces(unittest.TestCase): # Asserts standard ECUs exist for each platform common_ecus = {Ecu.fwdRadar, Ecu.fwdCamera} for car_model, ecus in FW_VERSIONS.items(): - with self.subTest(car_model=car_model): + with self.subTest(car_model=car_model.value): present_ecus = {ecu[0] for ecu in ecus} missing_ecus = common_ecus - present_ecus self.assertEqual(len(missing_ecus), 0) @@ -55,7 +55,7 @@ class TestToyotaFingerprint(unittest.TestCase): def test_platform_code_ecus_available(self): # Asserts ECU keys essential for fuzzy fingerprinting are available on all platforms for car_model, ecus in FW_VERSIONS.items(): - with self.subTest(car_model=car_model): + with self.subTest(car_model=car_model.value): for platform_code_ecu in PLATFORM_CODE_ECUS: if platform_code_ecu == Ecu.eps and car_model in (CAR.PRIUS_V, CAR.LEXUS_CTH,): continue @@ -70,7 +70,7 @@ class TestToyotaFingerprint(unittest.TestCase): # - expected parsing of ECU sub-versions for car_model, ecus in FW_VERSIONS.items(): - with self.subTest(car_model=car_model): + with self.subTest(car_model=car_model.value): for ecu, fws in ecus.items(): if ecu[0] not in PLATFORM_CODE_ECUS: continue