diff --git a/selfdrive/car/tests/test_models.py b/selfdrive/car/tests/test_models.py index 32dd7a45a41d8f..6e88e227cc3abc 100755 --- a/selfdrive/car/tests/test_models.py +++ b/selfdrive/car/tests/test_models.py @@ -84,7 +84,6 @@ def setUpClass(cls): car_fw = [] can_msgs = [] fingerprint = defaultdict(dict) - CP = None for msg in lr: if msg.which() == "can": for m in msg.can: @@ -92,12 +91,11 @@ def setUpClass(cls): fingerprint[m.src][m.address] = len(m.dat) can_msgs.append(msg) elif msg.which() == "carParams": - CP = msg.carParams - car_fw = CP.carFw - if CP.openpilotLongitudinalControl: + car_fw = msg.carParams.carFw + if msg.carParams.openpilotLongitudinalControl: disable_radar = True if cls.car_model is None and not cls.ci: - cls.car_model = CP.carFingerprint + cls.car_model = msg.carParams.carFingerprint if len(can_msgs) > int(50 / DT_CTRL): break @@ -106,11 +104,6 @@ def setUpClass(cls): cls.can_msgs = sorted(can_msgs, key=lambda msg: msg.logMonoTime) - # Sets enableDsu for cars with missing carFw - # TODO: get new route for TOYOTA.LEXUS_CTH - if len(car_fw) == 0 and CP is not None and CP.enableDsu: - car_fw = [car.CarParams.CarFw(ecu=car.CarParams.Ecu.unknown)] - cls.CarInterface, cls.CarController, cls.CarState = interfaces[cls.car_model] cls.CP = cls.CarInterface.get_params(cls.car_model, fingerprint, car_fw, disable_radar) assert cls.CP