From 017ad73096b84dc8c88df53217f2b67c3f1ef62e Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Wed, 28 Jun 2023 23:50:52 -0700 Subject: [PATCH] FwQueryConfig: test request lists (#28741) * request callbacks * support in IsoTpParallelQuery * tiny bit simpler * shorter lines * need to check length again, could return empty list * takes in prev response * typing * test * only test * simple test * revert this * subtest! old-commit-hash: 16203cc856f5f1fed779f34f94234d3eed9d978c --- selfdrive/car/tests/test_fw_fingerprint.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/selfdrive/car/tests/test_fw_fingerprint.py b/selfdrive/car/tests/test_fw_fingerprint.py index fd9030c7db..01d3663e67 100755 --- a/selfdrive/car/tests/test_fw_fingerprint.py +++ b/selfdrive/car/tests/test_fw_fingerprint.py @@ -160,6 +160,13 @@ class TestFwFingerprint(unittest.TestCase): self.assertFalse(len(whitelisted_ecus) and len(ecus_not_whitelisted), f'{brand.title()}: ECUs not in any FW query whitelists: {ecu_strings}') + def test_fw_requests(self): + # Asserts equal length request and response lists + for brand, config in FW_QUERY_CONFIGS.items(): + with self.subTest(brand=brand): + for request_obj in config.requests: + self.assertEqual(len(request_obj.request), len(request_obj.response)) + class TestFwFingerprintTiming(unittest.TestCase): N: int = 5