@@ -46,6 +46,7 @@ def tearDown(self):
46
46
47
47
def test_bus_creation (self ):
48
48
self .assertIsInstance (self .bus , canlib .KvaserBus )
49
+ self .assertEqual (self .bus .protocol , can .CanProtocol .CAN_20 )
49
50
self .assertTrue (canlib .canOpenChannel .called )
50
51
self .assertTrue (canlib .canBusOn .called )
51
52
@@ -149,7 +150,8 @@ def test_available_configs(self):
149
150
def test_canfd_default_data_bitrate (self ):
150
151
canlib .canSetBusParams .reset_mock ()
151
152
canlib .canSetBusParamsFd .reset_mock ()
152
- can .Bus (channel = 0 , interface = "kvaser" , fd = True )
153
+ bus = can .Bus (channel = 0 , interface = "kvaser" , fd = True )
154
+ self .assertEqual (bus .protocol , can .CanProtocol .CAN_FD )
153
155
canlib .canSetBusParams .assert_called_once_with (
154
156
0 , constants .canFD_BITRATE_500K_80P , 0 , 0 , 0 , 0 , 0
155
157
)
@@ -161,7 +163,8 @@ def test_canfd_nondefault_data_bitrate(self):
161
163
canlib .canSetBusParams .reset_mock ()
162
164
canlib .canSetBusParamsFd .reset_mock ()
163
165
data_bitrate = 2000000
164
- can .Bus (channel = 0 , interface = "kvaser" , fd = True , data_bitrate = data_bitrate )
166
+ bus = can .Bus (channel = 0 , interface = "kvaser" , fd = True , data_bitrate = data_bitrate )
167
+ self .assertEqual (bus .protocol , can .CanProtocol .CAN_FD )
165
168
bitrate_constant = canlib .BITRATE_FD [data_bitrate ]
166
169
canlib .canSetBusParams .assert_called_once_with (
167
170
0 , constants .canFD_BITRATE_500K_80P , 0 , 0 , 0 , 0 , 0
0 commit comments