diff --git a/Assertion.py b/Assertion.py new file mode 100644 index 00000000..bfd661d8 --- /dev/null +++ b/Assertion.py @@ -0,0 +1,11 @@ +from serial import Serial, SerialException + +with Serial('/your/port', 9600) as ser: + ser.write(bytes([0x1])) + assert ser.read() == bytes([0xaa]) + + ser.write(bytes([0x0])) + assert ser.read() == bytes([0xaa]) + + ser.write(bytes([0x2])) + assert ser.read() == bytes([0xff]) \ No newline at end of file