def test_go_to_sleep_should_return_valid_values(): api = 'API(602: 36; 3)\r\n' results = LPGAN_API_Rx.go_to_sleep(api) assert 36 == results['seconds_left_until_alarm'] assert 3 == results['alarm_id']
def test_go_to_sleep_should_raise_warning_for_pin_high(): with pytest.raises(Warning): LPGAN_API_Rx.go_to_sleep('API(603: 36; 3)')
def test_go_to_sleep_should_raise_exception_for_error(): with pytest.raises(ValueError): LPGAN_API_Rx.go_to_sleep('API(225)')