Exemple #1
0
def test_reset_both_encoders_invalid():
    serial = MockSerial(INVALID_RESPONSE)
    attiny = AttinyProtocol(serial)

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

    assert serial.received == ENCODERS_RESET_BOTH
Exemple #2
0
def test_reset_both_encoders_timeout():
    serial = MockSerial(b'')
    attiny = AttinyProtocol(serial)

    result = attiny.reset_encoders()

    assert serial.received == ENCODERS_RESET_BOTH
    assert result == False