diff options
author | Damien George <damien.p.george@gmail.com> | 2015-05-28 11:06:12 +0100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2015-05-28 11:06:12 +0100 |
commit | 6d1ff7e9665c253b26fec0f7696107ff8446185c (patch) | |
tree | 88f7508387f62f48ae2e5fa0f1582dc4676fdef9 /tests/pyb/spi.py | |
parent | 17d9b5006dc8dc585de6c52abfb1a65487e0d16d (diff) | |
download | micropython-6d1ff7e9665c253b26fec0f7696107ff8446185c.tar.gz micropython-6d1ff7e9665c253b26fec0f7696107ff8446185c.zip |
tests: Add tests to create valid and invalid UART, I2C, SPI, CAN busses.
Diffstat (limited to 'tests/pyb/spi.py')
-rw-r--r-- | tests/pyb/spi.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/pyb/spi.py b/tests/pyb/spi.py index 24a7a85a54..16b51e7e44 100644 --- a/tests/pyb/spi.py +++ b/tests/pyb/spi.py @@ -1,5 +1,13 @@ from pyb import SPI +# test we can correctly create by id or name +for bus in (-1, 0, 1, 2, 3, "X", "Y", "Z"): + try: + SPI(bus) + print("SPI", bus) + except ValueError: + print("ValueError", bus) + spi = SPI(1) print(spi) |