Skip to content

Commit

Permalink
add test for can define
Browse files Browse the repository at this point in the history
  • Loading branch information
pd0wm committed Dec 3, 2019
1 parent 0ba7926 commit da25c52
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions can/tests/test_define.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/env python3
import unittest

from opendbc.can.can_define import CANDefine

class TestCADNDefine(unittest.TestCase):
def test_civic(self):

dbc_file = "honda_civic_touring_2016_can_generated"
defs = CANDefine(dbc_file)

self.assertDictEqual(defs.dv[399], defs.dv['STEER_STATUS'])
self.assertDictEqual(defs.dv[399],
{'STEER_STATUS':
{6: 'TMP_FAULT',
5: 'FAULT_1',
4: 'NO_TORQUE_ALERT_2',
3: 'LOW_SPEED_LOCKOUT',
2: 'NO_TORQUE_ALERT_1',
0: 'NORMAL'}
}
)


if __name__ == "__main__":
unittest.main()

0 comments on commit da25c52

Please sign in to comment.