def test_stop_motors_undefined(): # send out something that is neither an ACK or a NAK byte serial = MockSerial(INVALID_RESPONSE) attiny = AttinyProtocol(serial) with pytest.raises(InvalidResponseException): attiny.stop_motors() assert serial.received == STOP_MOTORS
def test_stop_motors_timeout(): serial = MockSerial(b'') attiny = AttinyProtocol(serial) result = attiny.stop_motors() assert serial.received == STOP_MOTORS assert result == False
def test_stop_motors(): serial = MockSerial(ACK) attiny = AttinyProtocol(serial) result = attiny.stop_motors() assert serial.received == STOP_MOTORS assert result == True