Exemplo n.º 1
0
def test_decode_uncompressed_longitude_complete_garbage():
    with pytest.raises(ValueError):
        # Random garbage
        APRSUtils.decode_uncompressed_longitude("GARBAGE")
Exemplo n.º 2
0
def test_decode_uncompressed_longitude_malformed_longitude():
    with pytest.raises(ValueError):
        # Period is in the wrong position
        APRSUtils.decode_uncompressed_longitude("072017.5N")
Exemplo n.º 3
0
def test_decode_uncompressed_longitude_invalid_ambiguity():
    with pytest.raises(ValueError):
        # Ambiguity must be 1-4
        APRSUtils.decode_uncompressed_longitude("07201.75W", 5)
Exemplo n.º 4
0
def test_decode_uncompressed_longitude_invalid_direction():
    with pytest.raises(ValueError):
        # North is not a valid longitude direction
        APRSUtils.decode_uncompressed_longitude("07201.75N")
Exemplo n.º 5
0
def test_decode_uncompressed_longitude_invalid_longitude():
    with pytest.raises(ValueError):
        # 181 degrees west is not a valid longitude
        APRSUtils.decode_uncompressed_longitude("18100.00W")
Exemplo n.º 6
0
def test_decode_uncompressed_longitude_with_ambiguity_4():
    # Test uncompressed longitude with 4 levels of ambiguity
    lng = APRSUtils.decode_uncompressed_longitude("07211.75W", 4)

    assert lng == -72.0
Exemplo n.º 7
0
def test_decode_uncompressed_longitude_with_ambiguity_1():
    # Test uncompressed longitude with 1 level of ambiguity
    lng = APRSUtils.decode_uncompressed_longitude("07211.75W", 1)

    assert lng == -72.195
Exemplo n.º 8
0
def test_decode_uncompressed_longitude_without_ambiguity():
    # Test uncompressed longitude without ambiguity
    lng = APRSUtils.decode_uncompressed_longitude("07211.75W")

    assert lng == -72.195833