mirror of https://github.com/rusefi/opendbc.git
parent
b38a74af81
commit
33940105be
|
@ -0,0 +1,8 @@
|
|||
import glob
|
||||
import os
|
||||
|
||||
from opendbc import DBC_PATH
|
||||
|
||||
ALL_DBCS = [os.path.basename(dbc).split('.')[0] for dbc in
|
||||
glob.glob(f"{DBC_PATH}/*.dbc")]
|
||||
TEST_DBC = os.path.abspath(os.path.join(os.path.dirname(__file__), "test.dbc"))
|
|
@ -5,6 +5,7 @@ import unittest
|
|||
from opendbc.can.parser import CANParser, CANDefine
|
||||
from opendbc.can.packer import CANPacker
|
||||
|
||||
|
||||
class TestCanParserPackerExceptions(unittest.TestCase):
|
||||
def test_civic_exceptions(self):
|
||||
dbc_file = "honda_civic_touring_2016_can_generated"
|
||||
|
|
|
@ -1,19 +1,11 @@
|
|||
#!/usr/bin/env python3
|
||||
import glob
|
||||
import os
|
||||
import unittest
|
||||
|
||||
from opendbc import DBC_PATH
|
||||
from opendbc.can.parser import CANParser
|
||||
from opendbc.can.tests import ALL_DBCS
|
||||
|
||||
|
||||
class TestDBCParser(unittest.TestCase):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
cls.dbcs = []
|
||||
for dbc in glob.glob(f"{DBC_PATH}/*.dbc"):
|
||||
cls.dbcs.append(os.path.basename(dbc).split('.')[0])
|
||||
|
||||
def test_parse_all_dbcs(self):
|
||||
"""
|
||||
Dynamic DBC parser checks:
|
||||
|
@ -23,7 +15,7 @@ class TestDBCParser(unittest.TestCase):
|
|||
- All BO_, SG_, VAL_ lines for syntax errors
|
||||
"""
|
||||
|
||||
for dbc in self.dbcs:
|
||||
for dbc in ALL_DBCS:
|
||||
with self.subTest(dbc=dbc):
|
||||
CANParser(dbc, [], [], 0)
|
||||
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
#!/usr/bin/env python3
|
||||
import os
|
||||
import unittest
|
||||
import random
|
||||
from functools import partial
|
||||
|
@ -7,9 +6,7 @@ from functools import partial
|
|||
import cereal.messaging as messaging
|
||||
from opendbc.can.parser import CANParser
|
||||
from opendbc.can.packer import CANPacker
|
||||
|
||||
|
||||
TEST_DBC = os.path.abspath(os.path.join(os.path.dirname(__file__), "test.dbc"))
|
||||
from opendbc.can.tests import TEST_DBC
|
||||
|
||||
|
||||
# Python implementation so we don't have to depend on boardd
|
||||
|
|
Loading…
Reference in New Issue