diff options
Diffstat (limited to 'tests/pyb')
-rw-r--r-- | tests/pyb/halerror.py | 15 | ||||
-rw-r--r-- | tests/pyb/halerror.py.exp | 2 |
2 files changed, 17 insertions, 0 deletions
diff --git a/tests/pyb/halerror.py b/tests/pyb/halerror.py new file mode 100644 index 0000000000..1a6bce1a7e --- /dev/null +++ b/tests/pyb/halerror.py @@ -0,0 +1,15 @@ +# test hal errors + +import pyb + +i2c = pyb.I2C(2, pyb.I2C.MASTER) +try: + i2c.recv(1, 1) +except OSError as e: + print(repr(e)) + +can = pyb.CAN(1, pyb.CAN.NORMAL) +try: + can.send('1', 1, timeout=50) +except OSError as e: + print(repr(e)) diff --git a/tests/pyb/halerror.py.exp b/tests/pyb/halerror.py.exp new file mode 100644 index 0000000000..09c9f7ad92 --- /dev/null +++ b/tests/pyb/halerror.py.exp @@ -0,0 +1,2 @@ +OSError(5,) +OSError(116,) |