From 65d7b86902fbb1c291a8e24ef29b76fc0d543b62 Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Thu, 6 Feb 2025 21:17:01 -0600 Subject: [PATCH] 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 --- selfdrive/car/tests/test_models.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/selfdrive/car/tests/test_models.py b/selfdrive/car/tests/test_models.py index 7a1ea16272..f355d8b0b9 100644 --- a/selfdrive/car/tests/test_models.py +++ b/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()