Esempio n. 1
0
def test_reset_right_encoder_invalid():
    serial = MockSerial(INVALID_RESPONSE)
    attiny = AttinyProtocol(serial)

    with pytest.raises(InvalidResponseException):
        attiny.reset_right_encoder()

    assert serial.received == ENCODERS_RESET_RIGHT
Esempio n. 2
0
def test_reset_right_encoder_timeout():
    serial = MockSerial(b'')
    attiny = AttinyProtocol(serial)

    result = attiny.reset_right_encoder()

    assert serial.received == ENCODERS_RESET_RIGHT
    assert result == False