hardbyte / hardbyte/python-can

Test data contains invalid messages, but should not

Open
#750 29 comments 0 reactions 0 assignees View on GitHub
api question
Dominant language
Python
Stars
1.6k
Forks
697
PR merge metrics
No merged PRs in 30d

Description

Have a look at

logformats_test

def test_can_error_frame_ext(self):
expected = can.Message(
timestamp=2459565876.494607,
is_error_frame=True,
arbitration_id=0x19999999,
is_extended_id=True,
channel=0x1110,
**dlc=0x66**,
data=[0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, 0x33, 0x44],
)
actual = self._read_log_file("test_CanErrorFrameExt.blf")
self.assertMessagesEqual(actual, [expected] * 2)
self.assertEqual(actual[0].channel, expected.channel)

Even with an FD frame and treading dlc as length, this an invalid message. But code seems not to expect an invalid message.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.