Skip to content

Commit dca6357

Browse files
add test for VectorChannelConfig (hardbyte#942)
Co-authored-by: Felix Divo <felixdivo@users.noreply.github.com>
1 parent 7912632 commit dca6357

2 files changed

Lines changed: 25 additions & 2 deletions

File tree

can/interfaces/vector/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
22
"""
33

4-
from .canlib import VectorBus
4+
from .canlib import VectorBus, VectorChannelConfig
55
from .exceptions import VectorError

test/test_vector.py

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,13 @@
1414
import pytest
1515

1616
import can
17-
from can.interfaces.vector import canlib, xldefine, xlclass, VectorError
17+
from can.interfaces.vector import (
18+
canlib,
19+
xldefine,
20+
xlclass,
21+
VectorError,
22+
VectorChannelConfig,
23+
)
1824

1925

2026
class TestVectorBus(unittest.TestCase):
@@ -296,6 +302,23 @@ def test_vector_error_pickle(self) -> None:
296302
raise exc_unpickled
297303

298304

305+
class TestVectorChannelConfig:
306+
def test_attributes(self):
307+
assert hasattr(VectorChannelConfig, "name")
308+
assert hasattr(VectorChannelConfig, "hwType")
309+
assert hasattr(VectorChannelConfig, "hwIndex")
310+
assert hasattr(VectorChannelConfig, "hwChannel")
311+
assert hasattr(VectorChannelConfig, "channelIndex")
312+
assert hasattr(VectorChannelConfig, "channelMask")
313+
assert hasattr(VectorChannelConfig, "channelCapabilities")
314+
assert hasattr(VectorChannelConfig, "channelBusCapabilities")
315+
assert hasattr(VectorChannelConfig, "isOnBus")
316+
assert hasattr(VectorChannelConfig, "connectedBusType")
317+
assert hasattr(VectorChannelConfig, "serialNumber")
318+
assert hasattr(VectorChannelConfig, "articleNumber")
319+
assert hasattr(VectorChannelConfig, "transceiverName")
320+
321+
299322
def xlGetApplConfig(
300323
app_name_p: ctypes.c_char_p,
301324
app_channel: ctypes.c_uint,

0 commit comments

Comments
 (0)