def test_check_code_should_not_open_door_and_show_red_led_and_play_sad_sound_for_invalid_code(self): baron.check_code('666', reload_codes=False) self.assertEquals(None, self.urlopen_data) self.assertEquals(['SR'], baron.keypad.output)
def test_check_code_should_play_fail_sequence_if_api_returns_error(self): self.api_open_success = False baron.check_code('42', reload_codes=False) self.assertEquals(['SR', 'QSR', 'QSR'], baron.keypad.output)
def test_check_code_should_open_door_and_show_blue_led_and_play_happy_sound_for_valid_code(self): baron.check_code('42', reload_codes=False) self.assertEquals('open=1', self.urlopen_data) self.assertEquals(['BH'], baron.keypad.output)