Skip to content

Commit 83a20eb

Browse files
committed
fix doctest
1 parent b1b3592 commit 83a20eb

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

doc/interfaces/ixxat.rst

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,22 @@ The function :meth:`~can.detect_available_configs` can be used to generate a lis
6464
.. testsetup:: ixxat
6565

6666
from unittest.mock import Mock
67-
can.detect_available_configs = Mock(side_effect=lambda: [{'interface': 'ixxat', 'channel': 0, 'unique_hardware_id': 'HW441489'}, {'interface': 'ixxat', 'channel': 0, 'unique_hardware_id': 'HW107422'}, {'interface': 'ixxat', 'channel': 1, 'unique_hardware_id': 'HW107422'}])
67+
import can
68+
assert hasattr(can, "detect_available_configs")
69+
can.detect_available_configs = Mock(
70+
"interface",
71+
return_value=[{'interface': 'ixxat', 'channel': 0, 'unique_hardware_id': 'HW441489'}, {'interface': 'ixxat', 'channel': 0, 'unique_hardware_id': 'HW107422'}, {'interface': 'ixxat', 'channel': 1, 'unique_hardware_id': 'HW107422'}],
72+
)
6873

6974
.. doctest:: ixxat
7075

7176
>>> import can
72-
>>> print(can.detect_available_configs("ixxat"))
73-
[{'interface': 'ixxat', 'channel': 0, 'unique_hardware_id': 'HW509182'},
74-
{'interface': 'ixxat', 'channel': 0, 'unique_hardware_id': 'HW107422'},
75-
{'interface': 'ixxat', 'channel': 1, 'unique_hardware_id': 'HW107422'}]
77+
>>> configs = can.detect_available_configs("ixxat")
78+
>>> for config in configs:
79+
... print(config)
80+
{'interface': 'ixxat', 'channel': 0, 'unique_hardware_id': 'HW441489'}
81+
{'interface': 'ixxat', 'channel': 0, 'unique_hardware_id': 'HW107422'}
82+
{'interface': 'ixxat', 'channel': 1, 'unique_hardware_id': 'HW107422'}
7683

7784

7885
You may also get a list of all connected IXXAT devices using the function ``get_ixxat_hwids()`` as demonstrated below:

0 commit comments

Comments
 (0)