clean up hyundai test a bit

pull/28386/head
Shane Smiskol 2 years ago
parent 408cc082e6
commit 152a6d9340
  1. 7
      selfdrive/car/hyundai/tests/test_hyundai.py

@ -76,13 +76,13 @@ class TestHyundaiFingerprint(unittest.TestCase):
]
all_platform_codes = defaultdict(set)
for candidate, fw_by_addr in FW_VERSIONS.items():
for platform, fw_by_addr in FW_VERSIONS.items():
for addr, fws in fw_by_addr.items():
if addr[0] not in FW_QUERY_CONFIG.fuzzy_ecus:
continue
for platform_code in FW_QUERY_CONFIG.fuzzy_get_platform_codes(fws):
all_platform_codes[(addr[1], addr[2], platform_code)].add(candidate)
all_platform_codes[(addr[1], addr[2], platform_code)].add(platform)
platforms_with_shared_codes = []
for platform, fw_by_addr in FW_VERSIONS.items():
@ -91,8 +91,7 @@ class TestHyundaiFingerprint(unittest.TestCase):
if addr[0] not in FW_QUERY_CONFIG.fuzzy_ecus:
continue
for f in fws:
platform_code = list(FW_QUERY_CONFIG.fuzzy_get_platform_codes([f]))[0]
for platform_code in FW_QUERY_CONFIG.fuzzy_get_platform_codes(fws):
shared_codes.append(len(all_platform_codes[(addr[1], addr[2], platform_code)]) > 1)
# If all the platform codes for this platform are shared with another platform,

Loading…
Cancel
Save