Skip to content

Commit 0ee529c

Browse files
committed
Add testcase test_api_version_read_fail
1 parent 5a43bb8 commit 0ee529c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

test/test_pcan.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,11 @@ def test_api_version_error(self) -> None:
7171
with self.assertRaises(CanInitializationError):
7272
self.bus = can.Bus(bustype="pcan")
7373

74+
def test_api_version_read_fail(self) -> None:
75+
self.mock_pcan.GetValue = Mock(return_value=(PCAN_ERROR_ILLOPERATION, None))
76+
with self.assertRaises(CanInitializationError):
77+
self.bus = can.Bus(bustype="pcan")
78+
7479
@parameterized.expand(
7580
[
7681
("no_error", PCAN_ERROR_OK, PCAN_ERROR_OK, "some ok text 1"),

0 commit comments

Comments
 (0)