From 7c4503513f8653a558210f3a67ca453a9df87a6f Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Tue, 30 Jan 2024 00:59:55 -0800 Subject: [PATCH] add tests --- selfdrive/car/tests/test_fw_fingerprint.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/selfdrive/car/tests/test_fw_fingerprint.py b/selfdrive/car/tests/test_fw_fingerprint.py index 12bf61d410..e7ba67d433 100755 --- a/selfdrive/car/tests/test_fw_fingerprint.py +++ b/selfdrive/car/tests/test_fw_fingerprint.py @@ -147,6 +147,12 @@ class TestFwFingerprint(unittest.TestCase): with self.subTest(): self.fail(f"Brands do not implement FW_QUERY_CONFIG: {brand_versions - brand_configs}") + # Ensure each brand has at least 1 ECU to query, and extra ECU retrieval + for brand, config in FW_QUERY_CONFIGS.items(): + self.assertEqual(len(config.get_all_ecus({}, include_extra_ecus=False)), 0) + self.assertEqual(config.get_all_ecus({}, include_ecu_type=True), set(config.extra_ecus)) + self.assertGreater(len(config.get_all_ecus(VERSIONS[brand])), 0) + def test_fw_request_ecu_whitelist(self): for brand, config in FW_QUERY_CONFIGS.items(): with self.subTest(brand=brand):