summaryrefslogtreecommitdiffstatshomepage
path: root/tests/pyb/can.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/pyb/can.py')
-rw-r--r--tests/pyb/can.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/pyb/can.py b/tests/pyb/can.py
index 63a3be4e92..8c86349ea9 100644
--- a/tests/pyb/can.py
+++ b/tests/pyb/can.py
@@ -1,6 +1,14 @@
from pyb import CAN
import pyb
+# test we can correctly create by id or name
+for bus in (-1, 0, 1, 2, 3, "YA", "YB", "YC"):
+ try:
+ CAN(bus, CAN.LOOPBACK)
+ print("CAN", bus)
+ except ValueError:
+ print("ValueError", bus)
+
CAN.initfilterbanks(14)
can = CAN(1)
print(can)