コード例 #1
0
    def test_new_message(self):
        decoder = NecDecoder()
        start = decoder._find_start_index(TestNecDecoder.reference_pulses)

        decoder._classify_message(TestNecDecoder.reference_pulses, start)

        assert decoder.current_message_type == NEW_MESSAGE
コード例 #2
0
    def test_valid_pulses(self):
        decoder = NecDecoder()
        start = decoder._find_start_index(TestNecDecoder.reference_pulses)
        decoder._classify_message(TestNecDecoder.reference_pulses, start)

        assert decoder._validate_pulses(TestNecDecoder.reference_pulses, start)