circuitpython/tests/extmod/machine1.py
Jim Mussared 4216bc7d13 tests: Replace umodule with module everywhere.
This work was funded through GitHub Sponsors.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-06-08 17:54:24 +10:00

47 lines
642 B
Python

# test machine module
try:
import machine
machine.mem8
except:
print("SKIP")
raise SystemExit
print(machine.mem8)
try:
machine.mem16[1]
except ValueError:
print("ValueError")
try:
machine.mem16[1] = 1
except ValueError:
print("ValueError")
try:
del machine.mem8[0]
except TypeError:
print("TypeError")
try:
machine.mem8[0:1]
except TypeError:
print("TypeError")
try:
machine.mem8[0:1] = 10
except TypeError:
print("TypeError")
try:
machine.mem8["hello"]
except TypeError:
print("TypeError")
try:
machine.mem8["hello"] = 10
except TypeError:
print("TypeError")