def test_stop_buzzer(): serial = MockSerial(ACK) attiny = AttinyProtocol(serial) result = attiny.stop_buzzer() assert result == True assert serial.received == STOP_BUZZER
def test_stop_buzzer_invalid(): serial = MockSerial(INVALID_RESPONSE) attiny = AttinyProtocol(serial) with pytest.raises(InvalidResponseException): attiny.stop_buzzer()
def test_stop_buzzer_timeout(): serial = MockSerial(b'') attiny = AttinyProtocol(serial) result = attiny.stop_buzzer() assert result == False
def test_stop_buzzer_nak(): serial = MockSerial(NAK) attiny = AttinyProtocol(serial) result = attiny.stop_buzzer() assert result == False