コード例 #1
0
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']
コード例 #2
0
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)')
コード例 #3
0
def test_go_to_sleep_should_raise_exception_for_error():
    with pytest.raises(ValueError):
        LPGAN_API_Rx.go_to_sleep('API(225)')