def test_serial_write(capsys): arduino = serial.Serial(port=c.ARDUINO_PORT, baudrate=c.ARDUINO_BAUD, timeout=c.ARDUINO_TIMEOUT) arduino.write("test string") captured = capsys.readouterr() assert captured.out == "test string\n"
def __init__(self): self.serial = serial_mock.Serial( port=constants.ARDUINO_PORT, baudrate=constants.ARDUINO_BAUD, timeout=constants.ARDUINO_TIMEOUT, ) self.volume_in_pump = constants.volume_in_pump self.max_pump_capacity = constants.MAX_PUMP_CAPACITY
def test_serial_readline(): arduino = serial.Serial(port=c.ARDUINO_PORT, baudrate=c.ARDUINO_BAUD, timeout=c.ARDUINO_TIMEOUT) assert arduino.readline() == b"DONE\r\n"
def test_serial_flush(): arduino = serial.Serial(port=c.ARDUINO_PORT, baudrate=c.ARDUINO_BAUD, timeout=c.ARDUINO_TIMEOUT) arduino.flush()
def test_serial_create(): arduino = serial.Serial(port=c.ARDUINO_PORT, baudrate=c.ARDUINO_BAUD, timeout=c.ARDUINO_TIMEOUT) assert arduino is not None
def test_serial_writable(): arduino = serial.Serial(port=c.ARDUINO_PORT, baudrate=c.ARDUINO_BAUD, timeout=c.ARDUINO_TIMEOUT) assert arduino.writable()
def test_serial_input_buffer(): arduino = serial.Serial(port=c.ARDUINO_PORT, baudrate=c.ARDUINO_BAUD, timeout=c.ARDUINO_TIMEOUT) arduino.reset_input_buffer()
def test_serial_write(capsys): arduino = serial.Serial(port=c.ARDUINO_PORT, baudrate=c.ARDUINO_BAUD, timeout=c.ARDUINO_TIMEOUT) arduino.write("test string")