Model native receipt observation in selfdrived fixtures

This commit is contained in:
Dom
2026-11-01 23:17:30 -06:00
parent 5f741d9887
commit 9e2d7594eb
3 changed files with 6 additions and 4 deletions
@@ -63,7 +63,7 @@ class TestOrdinaryAxis(unittest.TestCase):
from openpilot.selfdrive.selfdrived.alertmanager import AlertManager
sd.AM = AlertManager()
sd.pm = Mock()
vars(sd)['sm'] = SimpleNamespace(frame=1)
vars(sd)['sm'] = SimpleNamespace(frame=1, seen={'aolSafetyWire': True})
sd.experimental_mode = False
sd.personality = 1
sd.conditional_replay = False
@@ -1233,7 +1233,7 @@ class IpcAxisContractTests(unittest.TestCase):
def test_lateral_only_receipt_loss_keeps_take_control_alert(self):
class SM:
seen = {'aolIntentWire': False}
seen = {'aolIntentWire': False, 'aolSafetyWire': False}
frame = 0
def __getitem__(self, service):
@@ -1293,6 +1293,7 @@ class IpcAxisContractTests(unittest.TestCase):
self.assertNotIn(ET.IMMEDIATE_DISABLE, sd.state_machine.current_alert_types)
self.assertNotEqual(sd.AM.current_alert.alert_text_1, 'TAKE CONTROL IMMEDIATELY')
sd.sm.seen['aolSafetyWire'] = True
sd.sm.frame = 2
sd.step()
self.assertEqual(sd.aol_axis_decision.mode, 'lateralOnly')
@@ -1882,7 +1883,7 @@ class IpcAxisContractTests(unittest.TestCase):
def test_native_receipt_gates_engagement_and_disables_on_loss(self):
class SM:
seen = {'aolIntentWire': False}
seen = {'aolIntentWire': False, 'aolSafetyWire': False}
def __getitem__(self, service):
if service == 'deviceState':
return SimpleNamespace(started=True, startedMonoTime=1)
@@ -1944,6 +1945,7 @@ class IpcAxisContractTests(unittest.TestCase):
self.assertTrue(sd.events.contains(ET.NO_ENTRY))
self.assertEqual(sd.aol_axis_decision.mode, 'off')
sd.publish_selfdriveState.assert_called_once() # disabled bootstrap still publishes the zero-axis request
sd.sm.seen['aolSafetyWire'] = True
sd.step()
self.assertTrue(sd.enabled and sd.active)
self.assertEqual(sd.aol_axis_decision.mode, 'combined')
+1 -1
View File
@@ -1 +1 @@
{"protected_inventory_sha256": "3c88c96a3d4067ed5c4cb263e809b67c05ac819dd274f40c42af5c974c0998d2", "schema_version": 1}
{"protected_inventory_sha256": "4ab96a0de5c3b4741be6c2723f4f24d5fb29619b722a6745fe1158eb13e6fe5b", "schema_version": 1}