Files
StarPilot/opendbc_repo/opendbc/can/tests/test_define.py
T
firestar5683 22a8575199 Vendor dependencies and resources for standalone builds
Keep official openpilot ancestry and dependency licenses. Store resources directly in Git, remove LFS setup requirements, and leave the downloadable big model outside the source tree.
2026-10-03 21:01:18 +00:00

30 lines
911 B
Python

import unittest
from opendbc.can import CANDefine
from opendbc.can.tests import ALL_DBCS
class TestCANDefine(unittest.TestCase):
def test_civic(self):
dbc_file = "honda_civic_touring_2016_can_generated"
defs = CANDefine(dbc_file)
assert defs.dv[399] == defs.dv['STEER_STATUS']
assert defs.dv[399] == {'STEER_STATUS':
{7: 'PERMANENT_FAULT',
6: 'TMP_FAULT',
5: 'FAULT_1',
4: 'NO_TORQUE_ALERT_2',
3: 'LOW_SPEED_LOCKOUT',
2: 'NO_TORQUE_ALERT_1',
1: 'DRIVER_STEERING',
0: 'NORMAL'}
}
def test_all_dbcs(self):
# Asserts no exceptions on all DBCs
for dbc in ALL_DBCS:
with self.subTest(dbc=dbc):
CANDefine(dbc)