コード例 #1
0
def test_get_location_should_pass_and_return_values():
    api = 'API(600: 0.000000; 0.000000; 136121891; -2147483648; 0.000000)\r\n'
    results = LPGAN_API_Rx.get_location(api)

    assert 0.0 == results['latitude']
    assert 0.0 == results['longitude']
    assert 136121891 == results['seconds_since_last_fix']
    assert -2147483648 == results['seconds_until_next_fix']
    assert 0.000000 == results['altitude']
コード例 #2
0
def test_get_location_should_raise_exception_for_error():
    with pytest.raises(ValueError):
        LPGAN_API_Rx.get_location('API(136)')