Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion test/test_bit_timing.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ def test_from_btr():
def test_btr_persistence():
f_clock = 8_000_000
for btr0btr1 in PCAN_BITRATES.values():
btr1, btr0 = struct.unpack("BB", btr0btr1)
btr0, btr1 = struct.pack(">H", btr0btr1.value)

t = can.BitTiming.from_registers(f_clock, btr0, btr1)
assert t.btr0 == btr0
Expand Down
5 changes: 2 additions & 3 deletions test/test_pcan.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"""

import ctypes
import struct
import unittest
from unittest import mock
from unittest.mock import Mock, patch
Expand Down Expand Up @@ -379,9 +380,7 @@ def test_detect_available_configs(self) -> None:
self.assertEqual(len(configs), 50)
else:
value = (TPCANChannelInformation * 1).from_buffer_copy(
b"Q\x00\x05\x00\x01\x00\x00\x00PCAN-USB FD\x00\x00\x00\x00"
b"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
b'\x00\x00\x00\x00\x00\x00\x003"\x11\x00\x01\x00\x00\x00'
struct.pack("HBBI33sII", 81, 5, 0, 1, b"PCAN-USB FD", 1122867, 1)
)
self.mock_pcan.GetValue = Mock(return_value=(PCAN_ERROR_OK, value))
configs = PcanBus._detect_available_configs()
Expand Down