From e61c7993afd095c5115b118a6d14397b50e5ec2e Mon Sep 17 00:00:00 2001 From: Dom <168790843+firestar5683@users.noreply.github.com> Date: Sat, 31 Oct 2026 23:59:05 -0500 Subject: [PATCH] Complete Card test interface fixtures for CAN observation --- opendbc_repo/opendbc/car/hyundai/tests/test_ioniq6_handoff.py | 2 +- openpilot/starpilot/controllers/tests/test_cruise_action.py | 2 +- openpilot/starpilot/speed_limits/tests/test_runtime_replay.py | 4 ++-- prebuilt.json | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/opendbc_repo/opendbc/car/hyundai/tests/test_ioniq6_handoff.py b/opendbc_repo/opendbc/car/hyundai/tests/test_ioniq6_handoff.py index a6c13552ba..5b3b17bb0b 100644 --- a/opendbc_repo/opendbc/car/hyundai/tests/test_ioniq6_handoff.py +++ b/opendbc_repo/opendbc/car/hyundai/tests/test_ioniq6_handoff.py @@ -901,7 +901,7 @@ class TestIoniq6PrepublicationHandoff(unittest.TestCase): card_owner.sm = SM() sent = [] card_owner.pm = SimpleNamespace(send=lambda service, packet: sent.append((service, packet))) - card_owner.CI = SimpleNamespace(CC=SimpleNamespace(), CS=SimpleNamespace(), + card_owner.CI = SimpleNamespace(CP=cp, CC=SimpleNamespace(), CS=SimpleNamespace(), update=Mock(side_effect=lambda packets: car.CarState(canValid=True, canTimeout=False)), apply=Mock(return_value=(structs.CarControl.Actuators(), [CanData(0x1A0, b'\0' * 8, 1)])), init=Mock()) diff --git a/openpilot/starpilot/controllers/tests/test_cruise_action.py b/openpilot/starpilot/controllers/tests/test_cruise_action.py index 4ee44d0dcc..f8b0b0af56 100644 --- a/openpilot/starpilot/controllers/tests/test_cruise_action.py +++ b/openpilot/starpilot/controllers/tests/test_cruise_action.py @@ -107,7 +107,7 @@ class TestControllerCruise(unittest.TestCase): vars(instance)['sm'] = self.sm instance.CC_prev = car.CarControl(enabled=True) instance.CS_prev = self.cs - vars(instance)['CI'] = SimpleNamespace(CS=SimpleNamespace(), update=lambda packets:self.cs) + vars(instance)['CI'] = SimpleNamespace(CC=None, CS=SimpleNamespace(), update=lambda packets:self.cs) instance.car_gps_publisher = card.CarGpsPublisher() self.enterContext(patch.object(instance, 'pm', SimpleNamespace(send=Mock()), create=True)) vars(instance)['RI'] = SimpleNamespace(update=lambda packets:None) diff --git a/openpilot/starpilot/speed_limits/tests/test_runtime_replay.py b/openpilot/starpilot/speed_limits/tests/test_runtime_replay.py index 735f6004b7..d28133c2b9 100644 --- a/openpilot/starpilot/speed_limits/tests/test_runtime_replay.py +++ b/openpilot/starpilot/speed_limits/tests/test_runtime_replay.py @@ -622,7 +622,7 @@ class RuntimeReplayTests(unittest.TestCase): {'carControl': car.CarControl(enabled=True, longActive=True), 'slcState': state.slcState, 'deviceState': SimpleNamespace(startedMonoTime=1)}, now_ns - 10_000_000)) self.enterContext(mock.patch.object(fake, 'CI', SimpleNamespace( - CS=SimpleNamespace(dashboard_limit=SimpleNamespace(observation=observation)), + CC=None, CS=SimpleNamespace(dashboard_limit=SimpleNamespace(observation=observation)), update=lambda packets: car.CarState(canValid=True, cruiseState={'available': True})), create=True)) self.enterContext(mock.patch.object(fake, 'RI', SimpleNamespace(update=lambda packets: None), create=True)) with (mock.patch.object(card.messaging, 'drain_sock_raw', return_value=[]), @@ -810,7 +810,7 @@ class RuntimeReplayTests(unittest.TestCase): current_cs = [car.CarState(canValid=True, cruiseState={'available': True}, buttonEvents=[car.CarState.ButtonEvent(type='accelCruise', pressed=True)])] self.enterContext(mock.patch.object(fake, 'CI', SimpleNamespace( - CS=SimpleNamespace(dashboard_limit=SimpleNamespace(observation=observation) if observation is not None else None), + CC=None, CS=SimpleNamespace(dashboard_limit=SimpleNamespace(observation=observation) if observation is not None else None), update=lambda packets: current_cs[0]), create=True)) self.enterContext(mock.patch.object(fake, 'RI', SimpleNamespace(update=lambda packets: None), create=True)) return fake, current_cs diff --git a/prebuilt.json b/prebuilt.json index e1eba2ba7b..45bed363d0 100644 --- a/prebuilt.json +++ b/prebuilt.json @@ -1 +1 @@ -{"protected_inventory_sha256": "63fb45ae947e658e222f3655bc8dceeeb31653ca8f867d706ce291d69e2cb027", "schema_version": 1} +{"protected_inventory_sha256": "11315c6f254dc3b38e35efe958ea0277cb399ba33f13db28405b0fcbf43a1f96", "schema_version": 1}