Files
StarPilot/openpilot/starpilot/aol/tests/test_vehicle.py
T
firestar5683 8571e16f68 Runtime AOL
Register vehicle AOL adapters and runtime dispatch after the vehicle factories and native contracts exist.

Co-authored-by: Dom <168790843+firestar5683@users.noreply.github.com>

Co-authored-by: prabhaavp <prabhaav@msu.edu>
2026-10-14 20:02:39 -05:00

21 lines
836 B
Python

"""Unknown vehicles have no implicit AOL capability or native receipt."""
import unittest
from types import SimpleNamespace
from openpilot.starpilot.aol.vehicle import AolVehiclePolicy, native_matches_cp, native_profile_supported, policy_for
class GenericVehiclePolicyTests(unittest.TestCase):
def test_unknown_and_malformed_cp_fail_closed(self):
denied = AolVehiclePolicy()
for cp in (None, SimpleNamespace(), SimpleNamespace(brand='ford'),
SimpleNamespace(brand='honda'), SimpleNamespace(brand='hyundai')):
with self.subTest(cp=cp):
self.assertEqual(policy_for(cp), denied)
self.assertFalse(native_matches_cp(cp, 0, 0))
def test_no_unregistered_native_profile(self):
self.assertFalse(native_profile_supported(0, 0))
self.assertFalse(native_profile_supported(999, 0x8815))