Use saved vehicle settings in learner recovery tests

This commit is contained in:
firestar5683
2026-11-01 21:57:07 -06:00
parent 9e4cba8695
commit 2ee94f3643
2 changed files with 9 additions and 3 deletions
@@ -1,6 +1,9 @@
import unittest
from unittest.mock import Mock, patch
from unittest.mock import patch
from opendbc.car.structs import car
from openpilot.common.params import Params
from openpilot.common.prefix import OpenpilotPrefix
from openpilot.system.manager import process
@@ -22,6 +25,9 @@ class Child:
class TestProcessRecovery(unittest.TestCase):
def setUp(self):
self.enterContext(OpenpilotPrefix())
self.params = Params()
self.cp = car.CarParams.new_message(brand="hyundai", carFingerprint="HYUNDAI_IONIQ_6")
self.now = 100.0
self.enterContext(patch.object(process, "Process", Child))
self.enterContext(patch.object(process.time, "monotonic", lambda: self.now))
@@ -33,7 +39,7 @@ class TestProcessRecovery(unittest.TestCase):
return process.PythonProcess("ui", "ui", lambda started, params, cp: started, restart_on_exit=restart)
def step(self, p, started=True, ignored=None):
process.ensure_running({p.name: p}.values(), started, Mock(), None, not_run=ignored)
process.ensure_running({p.name: p}.values(), started, self.params, self.cp, not_run=ignored)
def test_crash_restarts_after_delay_and_reaps_child(self):
p = self.make_process()
+1 -1
View File
@@ -1 +1 @@
{"protected_inventory_sha256": "7ffdb4369863f5c6e9e1e565da3a6d80d3fea249ad206bbce19e37252a0145ac", "schema_version": 1}
{"protected_inventory_sha256": "a4a2166bebeaf5e39742512e91e7373fe4a6199630879f7212d5af16b2ea8f35", "schema_version": 1}