Exemple #1
0
def test_decode_uncompressed_longitude_complete_garbage():
    with pytest.raises(ValueError):
        # Random garbage
        APRSUtils.decode_uncompressed_longitude("GARBAGE")
Exemple #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")
Exemple #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)
Exemple #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")
Exemple #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")
Exemple #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
Exemple #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
Exemple #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