Skip to content

Commit cc94290

Browse files
committed
formatting
1 parent 788e157 commit cc94290

File tree

2 files changed

+18
-15
lines changed

2 files changed

+18
-15
lines changed

can/interfaces/vector/canlib.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -462,13 +462,13 @@ def _set_output_mode(self, channel_mask: int, listen_only: bool) -> None:
462462
self.xldriver.xlCanSetChannelOutput(
463463
self.port_handle,
464464
channel_mask,
465-
xldefine.XL_OutputMode.XL_OUTPUT_MODE_SILENT
465+
xldefine.XL_OutputMode.XL_OUTPUT_MODE_SILENT,
466466
)
467467
else:
468468
self.xldriver.xlCanSetChannelOutput(
469469
self.port_handle,
470470
channel_mask,
471-
xldefine.XL_OutputMode.XL_OUTPUT_MODE_NORMAL
471+
xldefine.XL_OutputMode.XL_OUTPUT_MODE_NORMAL,
472472
)
473473

474474
LOG.info("xlCanSetChannelOutput: listen_only=%u", listen_only)
@@ -673,9 +673,11 @@ def _apply_filters(self, filters: Optional[CanFilters]) -> None:
673673
self.mask,
674674
can_filter["can_id"],
675675
can_filter["can_mask"],
676-
xldefine.XL_AcceptanceFilter.XL_CAN_EXT
677-
if can_filter.get("extended")
678-
else xldefine.XL_AcceptanceFilter.XL_CAN_STD,
676+
(
677+
xldefine.XL_AcceptanceFilter.XL_CAN_EXT
678+
if can_filter.get("extended")
679+
else xldefine.XL_AcceptanceFilter.XL_CAN_STD
680+
),
679681
)
680682
except VectorOperationError as exception:
681683
LOG.warning("Could not set filters: %s", exception)

test/test_vector.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -80,25 +80,26 @@ def mock_xldriver() -> None:
8080

8181

8282
def test_listen_only_mocked(mock_xldriver) -> None:
83-
bus = can.Bus(channel=0,
84-
interface="vector",
85-
listen_only=True,
86-
_testing=True)
83+
bus = can.Bus(channel=0, interface="vector", listen_only=True, _testing=True)
8784
assert isinstance(bus, canlib.VectorBus)
8885
assert bus.protocol == can.CanProtocol.CAN_20
8986

9087
can.interfaces.vector.canlib.xldriver.xlCanSetChannelOutput.assert_called()
91-
xlCanSetChannelOutput_args = can.interfaces.vector.canlib.xldriver.xlCanSetChannelOutput.call_args[0]
88+
xlCanSetChannelOutput_args = (
89+
can.interfaces.vector.canlib.xldriver.xlCanSetChannelOutput.call_args[0]
90+
)
9291
assert xlCanSetChannelOutput_args[2] == xldefine.XL_OutputMode.XL_OUTPUT_MODE_SILENT
9392

9493

9594
@pytest.mark.skipif(not XLDRIVER_FOUND, reason="Vector XL API is unavailable")
9695
def test_listen_only() -> None:
97-
bus = can.Bus(channel=0,
98-
serial=_find_virtual_can_serial(),
99-
interface="vector",
100-
receive_own_messages=True,
101-
listen_only=True)
96+
bus = can.Bus(
97+
channel=0,
98+
serial=_find_virtual_can_serial(),
99+
interface="vector",
100+
receive_own_messages=True,
101+
listen_only=True,
102+
)
102103
assert isinstance(bus, canlib.VectorBus)
103104
assert bus.protocol == can.CanProtocol.CAN_20
104105

0 commit comments

Comments
 (0)