From e4ce26118d603038cad146b8a48c54fc1c0ff501 Mon Sep 17 00:00:00 2001 From: zariiii9003 <52598363+zariiii9003@users.noreply.github.com> Date: Sat, 21 Nov 2020 18:21:02 +0100 Subject: [PATCH] add test for VectorChannelConfig --- can/interfaces/vector/__init__.py | 2 +- test/test_vector.py | 25 ++++++++++++++++++++++++- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/can/interfaces/vector/__init__.py b/can/interfaces/vector/__init__.py index 813608a86..7fc567017 100644 --- a/can/interfaces/vector/__init__.py +++ b/can/interfaces/vector/__init__.py @@ -1,5 +1,5 @@ """ """ -from .canlib import VectorBus +from .canlib import VectorBus, VectorChannelConfig from .exceptions import VectorError diff --git a/test/test_vector.py b/test/test_vector.py index 152d04024..76983dec4 100644 --- a/test/test_vector.py +++ b/test/test_vector.py @@ -14,7 +14,13 @@ import pytest import can -from can.interfaces.vector import canlib, xldefine, xlclass, VectorError +from can.interfaces.vector import ( + canlib, + xldefine, + xlclass, + VectorError, + VectorChannelConfig, +) class TestVectorBus(unittest.TestCase): @@ -296,6 +302,23 @@ def test_vector_error_pickle(self) -> None: raise exc_unpickled +class TestVectorChannelConfig: + def test_attributes(self): + assert hasattr(VectorChannelConfig, "name") + assert hasattr(VectorChannelConfig, "hwType") + assert hasattr(VectorChannelConfig, "hwIndex") + assert hasattr(VectorChannelConfig, "hwChannel") + assert hasattr(VectorChannelConfig, "channelIndex") + assert hasattr(VectorChannelConfig, "channelMask") + assert hasattr(VectorChannelConfig, "channelCapabilities") + assert hasattr(VectorChannelConfig, "channelBusCapabilities") + assert hasattr(VectorChannelConfig, "isOnBus") + assert hasattr(VectorChannelConfig, "connectedBusType") + assert hasattr(VectorChannelConfig, "serialNumber") + assert hasattr(VectorChannelConfig, "articleNumber") + assert hasattr(VectorChannelConfig, "transceiverName") + + def xlGetApplConfig( app_name_p: ctypes.c_char_p, app_channel: ctypes.c_uint,