safety tests: fix for common longitudinal accel class (#1299)

* fix

* fix

* something that would catch this
This commit is contained in:
Shane Smiskol 2023-03-21 12:42:02 -07:00 committed by GitHub
parent 2136e2e45b
commit ba50c2ffee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 2 deletions

View File

@ -133,8 +133,8 @@ class InterceptorSafetyTest(PandaSafetyTestBase):
class LongitudinalAccelSafetyTest(PandaSafetyTestBase, abc.ABC):
MIN_ACCEL: float = 2.0
MAX_ACCEL: float = -3.5
MAX_ACCEL: float = 2.0
MIN_ACCEL: float = -3.5
INACTIVE_ACCEL: float = 0.0
@classmethod
@ -147,6 +147,10 @@ class LongitudinalAccelSafetyTest(PandaSafetyTestBase, abc.ABC):
def _accel_msg(self, accel: float):
pass
def test_accel_limits_correct(self):
self.assertGreater(self.MAX_ACCEL, 0)
self.assertLess(self.MIN_ACCEL, 0)
def test_accel_actuation_limits(self, stock_longitudinal=False):
limits = ((self.MIN_ACCEL, self.MAX_ACCEL, ALTERNATIVE_EXPERIENCE.DEFAULT),
(self.MIN_ACCEL, self.MAX_ACCEL, ALTERNATIVE_EXPERIENCE.RAISE_LONGITUDINAL_LIMITS_TO_ISO_MAX))