diff --git a/tests/safety/hyundai_common.py b/tests/safety/hyundai_common.py index c17db8e53b..929ad1a65f 100644 --- a/tests/safety/hyundai_common.py +++ b/tests/safety/hyundai_common.py @@ -118,24 +118,21 @@ def test_set_resume_buttons(self): """ SET and RESUME enter controls allowed on their falling edge. """ - for acc_main_on in (True, False): - self.safety.set_acc_main_on(acc_main_on) - for btn_prev in range(8): - for btn_cur in range(8): - self._rx(self._button_msg(Buttons.NONE)) - self.safety.set_controls_allowed(0) - for _ in range(10): - self._rx(self._button_msg(btn_prev)) - self.assertFalse(self.safety.get_controls_allowed()) - - # should enter controls allowed on falling edge and not transitioning to cancel - should_enable = acc_main_on and \ - btn_cur != btn_prev and \ - btn_cur != Buttons.CANCEL and \ - btn_prev in (Buttons.RESUME, Buttons.SET) - - self._rx(self._button_msg(btn_cur)) - self.assertEqual(should_enable, self.safety.get_controls_allowed()) + for btn_prev in range(8): + for btn_cur in range(8): + self._rx(self._button_msg(Buttons.NONE)) + self.safety.set_controls_allowed(0) + for _ in range(10): + self._rx(self._button_msg(btn_prev)) + self.assertFalse(self.safety.get_controls_allowed()) + + # should enter controls allowed on falling edge and not transitioning to cancel + should_enable = btn_cur != btn_prev and \ + btn_cur != Buttons.CANCEL and \ + btn_prev in (Buttons.RESUME, Buttons.SET) + + self._rx(self._button_msg(btn_cur)) + self.assertEqual(should_enable, self.safety.get_controls_allowed()) def test_cancel_button(self): self.safety.set_controls_allowed(1)