Files
opendbc/opendbc/can/tests/test_define.py
Shane Smiskol c64b060c80 unittest-parallel: add back missing tests (#3345)
test missing stuff
2026-04-21 22:56:25 -07: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)