def test_if_sketch_version_is_a_major_change_above_required_version() -> None: conn_class = Mock(spec=SerialConnection) v = Arduino.min_version sketch_version = (v[0] + 1, v[1], v[2]) conn_class.build.return_value.process_command.return_value = sketch_version with pytest.raises(ArduinoSketchVersionIncompatibleError): Arduino(pins=(), port="", conn_class=conn_class)
def test_arduino() -> Arduino: pins = ( Pin(0), Pin(1, is_analog=True), Pin(2, is_pwm=True), Pin(3), Pin(4), Pin(5), ) return Arduino(pins=pins, port="", conn_class=get_mock_conn_class(), rx_pin=4, tx_pin=5)
def test_if_sketch_version_is_a_micro_change_above_required_version() -> None: conn_class = Mock(spec=SerialConnection) v = Arduino.min_version sketch_version = (v[0], v[1], v[2] + 1) conn_class.build.return_value.process_command.return_value = sketch_version Arduino(pins=(), port="", conn_class=conn_class)