test_models: remove selfdrived dependency (#34539)

* remove selfdrived

* fully

* todo

* yay

* moremoremore

* clean up

* more

* don't care

* update refs

* bump to master

* no more selfdrived

* yup

* too complex

* Update selfdrive/car/tests/test_models.py

* Update selfdrive/car/tests/test_models.py
pull/34545/head
Shane Smiskol 3 months ago committed by GitHub
parent 151e5ba20f
commit 65d7b86902
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 12
      selfdrive/car/tests/test_models.py

@ -17,8 +17,6 @@ from opendbc.car.car_helpers import FRAME_FINGERPRINT, interfaces
from opendbc.car.honda.values import CAR as HONDA, HondaFlags
from opendbc.car.values import Platform
from opendbc.car.tests.routes import non_tested_cars, routes, CarTestRoute
from openpilot.selfdrive.selfdrived.events import ET
from openpilot.selfdrive.selfdrived.selfdrived import SelfdriveD
from openpilot.selfdrive.pandad import can_capnp_to_list
from openpilot.selfdrive.test.helpers import read_segment_list
from openpilot.system.hardware.hw import DEFAULT_DOWNLOAD_CACHE_ROOT
@ -28,6 +26,7 @@ from openpilot.tools.lib.route import SegmentName
from panda.tests.libpanda import libpanda_py
ButtonType = car.CarState.ButtonEvent.Type
EventName = log.OnroadEvent.EventName
PandaType = log.PandaState.PandaType
SafetyModel = car.CarParams.SafetyModel
@ -384,8 +383,6 @@ class TestCarModelBase(unittest.TestCase):
controls_allowed_prev = False
CS_prev = car.CarState.new_message()
checks = defaultdict(int)
selfdrived = SelfdriveD(CP=self.CP)
selfdrived.initialized = True
for idx, can in enumerate(self.can_msgs):
CS = self.CI.update(can_capnp_to_list((can.as_builder().to_bytes(), ))).as_reader()
for msg in filter(lambda m: m.src in range(64), can.can):
@ -429,11 +426,8 @@ class TestCarModelBase(unittest.TestCase):
if not self.CP.notCar:
checks['cruiseState'] += CS.cruiseState.enabled != self.safety.get_cruise_engaged_prev()
else:
# Check for enable events on rising edge of controls allowed
selfdrived.update_events(CS)
selfdrived.CS_prev = CS
button_enable = (selfdrived.events.contains(ET.ENABLE) and
EventName.pedalPressed not in selfdrived.events.names)
# Check for user button enable on rising edge of controls allowed
button_enable = CS.buttonEnable and (not CS.brakePressed or CS.standstill)
mismatch = button_enable != (self.safety.get_controls_allowed() and not controls_allowed_prev)
checks['controlsAllowed'] += mismatch
controls_allowed_prev = self.safety.get_controls_allowed()

Loading…
Cancel
Save