diff --git a/selfdrive/car/toyota/tests/test_toyota.py b/selfdrive/car/toyota/tests/test_toyota.py index 3f09313589..72469f52d1 100755 --- a/selfdrive/car/toyota/tests/test_toyota.py +++ b/selfdrive/car/toyota/tests/test_toyota.py @@ -60,7 +60,7 @@ class TestToyotaFingerprint(unittest.TestCase): # get_platform_codes(fws) def test_fw_pattern(self): - return + # return for car_model, ecus in FW_VERSIONS.items(): # print() # print(car_model) @@ -219,21 +219,32 @@ class TestToyotaFingerprint(unittest.TestCase): # def test_fuzzy_excluded_platforms(self): # Asserts a list of platforms that will not fuzzy fingerprint with platform codes due to them being shared. - # This list can be shrunk as we combine platforms and detect features - # excluded_platforms = { - # CAR.GENESIS_G70, # shared platform code, part number, and date - # CAR.GENESIS_G70_2020, - # CAR.TUCSON_4TH_GEN, # shared platform code and part number - # CAR.TUCSON_HYBRID_4TH_GEN, - # } - # excluded_platforms |= CANFD_CAR - EV_CAR # shared platform codes - # excluded_platforms |= NO_DATES_PLATFORMS # date codes are required to match - excluded_platforms = set() + # This list can be shrunk as we combine platforms, detect features, and add the hybrid ECU + excluded_platforms = { + CAR.LEXUS_ESH_TSS2, + CAR.RAV4_TSS2_2022, + CAR.LEXUS_ES_TSS2, + CAR.RAV4_TSS2, + CAR.RAV4_TSS2_2023, + CAR.CAMRY, + CAR.HIGHLANDER_TSS2, + CAR.RAV4H_TSS2, + CAR.LEXUS_RX_TSS2, + CAR.CAMRYH_TSS2, + CAR.CHR, + CAR.RAV4H, + CAR.RAV4H_TSS2_2022, + CAR.HIGHLANDERH_TSS2, + CAR.RAV4, + CAR.CHR_TSS2, + CAR.CHRH, + CAR.RAV4H_TSS2_2023, + CAR.CAMRY_TSS2, + CAR.COROLLA_TSS2, + } platforms_with_shared_codes = set() for platform, fw_by_addr in FW_VERSIONS.items(): - # if platform != 'TOYOTA RAV4 2022': - # continue car_fw = [] for ecu, fw_versions in fw_by_addr.items(): ecu_name, addr, sub_addr = ecu @@ -243,23 +254,6 @@ class TestToyotaFingerprint(unittest.TestCase): CP = car.CarParams.new_message(carFw=car_fw) matches = FW_QUERY_CONFIG.match_fw_to_car_fuzzy(build_fw_dict(CP.carFw)) - if matches in ( - {CAR.RAV4, CAR.RAV4H}, - {CAR.RAV4_TSS2, CAR.RAV4H_TSS2}, - {CAR.RAV4_TSS2_2022, CAR.RAV4H_TSS2_2022}, - {CAR.RAV4_TSS2_2023, CAR.RAV4H_TSS2_2023}, - {CAR.COROLLA_TSS2, CAR.COROLLAH_TSS2}, - {CAR.HIGHLANDER, CAR.HIGHLANDERH}, - {CAR.HIGHLANDER_TSS2, CAR.HIGHLANDERH_TSS2}, - {CAR.CAMRY, CAR.CAMRYH}, - {CAR.CAMRY_TSS2, CAR.CAMRYH_TSS2}, - {CAR.CHR, CAR.CHRH}, - {CAR.CHR_TSS2, CAR.CHRH_TSS2}, - {CAR.LEXUS_ES, CAR.LEXUS_ESH}, - {CAR.LEXUS_ES_TSS2, CAR.LEXUS_ESH_TSS2}, - ): - matches = {platform} - print('matches', matches) if len(matches) == 1: self.assertEqual(list(matches)[0], platform) else: