Exemple #1
0
def test_set_location_should_pass_and_return_values():
    api = 'API(600: 54.333229; 4.212332; -157938633; -2147483648; 0.000000)\r\n'
    results = LPGAN_API_Rx.set_location(api)

    assert 54.333229 == results['latitude']
    assert 4.212332 == results['longitude']
    assert -157938633 == results['seconds_since_last_fix']
    assert -2147483648 == results['seconds_until_next_fix']
    assert 0.000000 == results['altitude']
Exemple #2
0
def test_set_location_should_raise_exceptions_for_errors():
    with pytest.raises(ValueError):
        LPGAN_API_Rx.set_location('API(225)')