mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-11-05 03:54:04 +08:00
Use saved vehicle settings in learner recovery tests
This commit is contained in:
@@ -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
@@ -1 +1 @@
|
||||
{"protected_inventory_sha256": "7ffdb4369863f5c6e9e1e565da3a6d80d3fea249ad206bbce19e37252a0145ac", "schema_version": 1}
|
||||
{"protected_inventory_sha256": "a4a2166bebeaf5e39742512e91e7373fe4a6199630879f7212d5af16b2ea8f35", "schema_version": 1}
|
||||
|
||||
Reference in New Issue
Block a user