From ab9019e57f21dd2a0976267214528244d60eb64f Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Thu, 18 Nov 2021 20:42:48 -0800 Subject: [PATCH] test car models: only check cruise state on PCM cruise cars old-commit-hash: 2723cc6cf8c6481a510c9347ef0526b53f679e43 --- selfdrive/test/test_models.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/selfdrive/test/test_models.py b/selfdrive/test/test_models.py index bbea50dca8..148f77a15c 100755 --- a/selfdrive/test/test_models.py +++ b/selfdrive/test/test_models.py @@ -178,7 +178,8 @@ class TestCarModel(unittest.TestCase): # check that openpilot and panda safety agree on the car's state checks['gasPressed'] += CS.gasPressed != safety.get_gas_pressed_prev() checks['brakePressed'] += CS.brakePressed != safety.get_brake_pressed_prev() - checks['controlsAllowed'] += not CS.cruiseState.enabled and safety.get_controls_allowed() + if self.CP.pcmCruise: + checks['controlsAllowed'] += not CS.cruiseState.enabled and safety.get_controls_allowed() # TODO: reduce tolerance to 0 failed_checks = {k: v for k, v in checks.items() if v > 25}