opendbc.can.tests package

Submodules

opendbc.can.tests.test_checksums module

class opendbc.can.tests.test_checksums.TestCanChecksums(methodName='runTest')[source]

Bases: TestCase

test_honda_checksum()[source]

Test checksums for Honda standard and extended CAN ids

opendbc.can.tests.test_dbc_exceptions module

class opendbc.can.tests.test_dbc_exceptions.TestCanParserPackerExceptions(methodName='runTest')[source]

Bases: TestCase

test_civic_exceptions()[source]

opendbc.can.tests.test_dbc_parser module

class opendbc.can.tests.test_dbc_parser.TestDBCParser(methodName='runTest')[source]

Bases: TestCase

test_enough_dbcs()[source]
test_parse_all_dbcs()[source]
Dynamic DBC parser checks:
  • Checksum and counter length, start bit, endianness

  • Duplicate message addresses and names

  • Signal out of bounds

  • All BO_, SG_, VAL_ lines for syntax errors

opendbc.can.tests.test_define module

class opendbc.can.tests.test_define.TestCADNDefine(methodName='runTest')[source]

Bases: TestCase

test_all_dbcs()[source]
test_civic()[source]

opendbc.can.tests.test_packer_parser module

class opendbc.can.tests.test_packer_parser.TestCanParserPacker(methodName='runTest')[source]

Bases: TestCase

test_bus_timeout()[source]

Test CAN bus timeout detection

test_disallow_duplicate_messages()[source]
test_nonexistent_messages()[source]
test_packer()[source]
test_packer_counter()[source]
test_packer_parser()[source]
test_parser_can_valid()[source]
test_parser_counter_can_valid()[source]

Tests number of allowed bad counters + ensures CAN stays invalid while receiving invalid messages + that we can recover

test_parser_no_partial_update()[source]

Ensure that the CANParser doesn’t partially update messages with invalid signals (COUNTER/CHECKSUM). Previously, the signal update loop would only break once it got to one of these invalid signals, after already updating most/all of the signals.

test_scale_offset()[source]

Test that both scale and offset are correctly preserved

test_subaru()[source]
test_timestamp_nanos()[source]

Test message timestamp dict

test_track_all_signals()[source]
test_updated()[source]

Test updated value dict

opendbc.can.tests.test_packer_parser.can_list_to_can_capnp(can_msgs, msgtype='can', logMonoTime=None)[source]

opendbc.can.tests.test_parser_performance module

class opendbc.can.tests.test_parser_performance.TestParser(methodName='runTest')[source]

Bases: TestCase

test_performance_all_signals()[source]

Module contents