def test_alive_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.alive() assert serial.received == ALIVE
def test_alive_nak(): # send out an NAK byte serial = MockSerial(NAK) attiny = AttinyProtocol(serial) result = attiny.alive() assert serial.received == ALIVE assert result == False
def test_alive_ack(): # send out an ACK byte serial = MockSerial(ACK) attiny = AttinyProtocol(serial) result = attiny.alive() assert serial.received == ALIVE assert result == True