File tree 2 files changed +11
-0
lines changed
2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change 56
56
PCAN_CHANNEL_FEATURES ,
57
57
FEATURE_FD_CAPABLE ,
58
58
PCAN_DICT_STATUS ,
59
+ PCAN_BUSOFF_AUTORESET
59
60
)
60
61
61
62
Original file line number Diff line number Diff line change @@ -363,6 +363,16 @@ def get_value_side_effect(handle, param):
363
363
self .bus = can .Bus (bustype = "pcan" , device_id = dev_id )
364
364
self .assertEqual (expected_result , self .bus .channel_info )
365
365
366
+ def test_bus_creation_auto_reset (self ):
367
+ self .bus = can .Bus (bustype = "pcan" , auto_reset = True )
368
+ self .assertIsInstance (self .bus , PcanBus )
369
+ self .MockPCANBasic .assert_called_once ()
370
+
371
+ def test_auto_reset_init_fault (self ):
372
+ self .mock_pcan .SetValue = Mock (return_value = PCAN_ERROR_INITIALIZE )
373
+ with self .assertRaises (CanInitializationError ):
374
+ self .bus = can .Bus (bustype = "pcan" , auto_reset = True )
375
+
366
376
367
377
if __name__ == "__main__" :
368
378
unittest .main ()
You can’t perform that action at this time.
0 commit comments