Skip to content

Commit cdfa26a

Browse files
committed
enable j1939 tests
1 parent 1e31b42 commit cdfa26a

4 files changed

Lines changed: 7 additions & 5 deletions

File tree

src/canmatrix/j1939_decoder.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515

1616
@attr.s
1717
class j1939_decoder(object):
18-
string = read_binary(__name__.rpartition('.')[0], "j1939.dbc")
18+
#string = read_binary(__name__.rpartition('.')[0], "j1939.dbc")
19+
with open( "j1939.dbc", "rb") as fd:
20+
string = fd.read()
1921
j1939_db = canmatrix.formats.loads_flat(
2022
string, import_type="dbc", dbcImportEncoding="utf8"
2123
)

tests/test_canmatrix.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def test_arbitration_id_is_instance():
4545
assert frame1.arbitration_id.id == 42
4646
assert frame2.arbitration_id.id == 0
4747

48-
@pytest.mark.skip(reason="J1939 functionality is only partially implemented and currently breaks test chain")
48+
#@pytest.mark.skip(reason="J1939 functionality is only partially implemented and currently breaks test chain")
4949
def test_arbitration_id_j1939_direct_setters():
5050
arb_id = ArbitrationId(0)
5151
arb_id.pgn = 0xF1AA

tests/test_dbc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ def test_writing_complex_multiplex():
301301
canmatrix.formats.dump(db, outdbc, "dbc")
302302
for line in outdbc.getvalue().decode('utf8').split('\n'):
303303
if "SG_MUL_VAL" in line:
304-
return True
304+
return
305305
assert False
306306

307307

@@ -318,7 +318,7 @@ def test_defines_with_special_cars():
318318
matrix = canmatrix.formats.dbc.load(dbc, dbcImportEncoding="utf8")
319319
assert matrix.frames[0].signals[0].attributes["Accuracy"] == "+/- 10.2 at 55.1%"
320320

321-
@pytest.mark.skip(reason="J1939 functionality is only partially implemented and currently breaks test chain")
321+
#@pytest.mark.skip(reason="J1939 functionality is only partially implemented and currently breaks test chain")
322322
def test_j1939_frametype():
323323
dbc = io.BytesIO(textwrap.dedent(u'''\
324324
BU_: someOtherEcu

tests/test_j1939_decoder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
from canmatrix.ArbitrationId import ArbitrationId
1111

12-
@pytest.mark.skip(reason="J1939 functionality is only partially implemented and currently breaks test chain")
12+
#@pytest.mark.skip(reason="J1939 functionality is only partially implemented and currently breaks test chain")
1313
def test_j1939_decoder():
1414
dbc = io.BytesIO(textwrap.dedent(u'''\
1515
BO_ 2566856834 CM_Requests: 9 CGW

0 commit comments

Comments
 (0)