test_models: check panda cruise state (#29423)

* cruise state test

* add todo

* rename

* clean up

* remove
old-commit-hash: 2d636deb4e
beeps
Shane Smiskol 2 years ago committed by GitHub
parent 2fc1ed6d5d
commit dc6af2820a
  1. 4
      selfdrive/car/tests/test_models.py

@ -344,6 +344,10 @@ class TestCarModelBase(unittest.TestCase):
checks['controlsAllowed'] += not self.safety.get_controls_allowed() checks['controlsAllowed'] += not self.safety.get_controls_allowed()
else: else:
checks['controlsAllowed'] += not CS.cruiseState.enabled and self.safety.get_controls_allowed() checks['controlsAllowed'] += not CS.cruiseState.enabled and self.safety.get_controls_allowed()
# TODO: fix notCar mismatch
if not self.CP.notCar:
checks['cruiseState'] += CS.cruiseState.enabled != self.safety.get_cruise_engaged_prev()
else: else:
# Check for enable events on rising edge of controls allowed # Check for enable events on rising edge of controls allowed
button_enable = any(evt.enable for evt in CS.events) button_enable = any(evt.enable for evt in CS.events)

Loading…
Cancel
Save