Beispiel #1
0
def test_parse_compressed_position_with_altitude():
    (lat, lng, alt, course, speed, radio_range, fix, source,
     origin) = PositionPacket._parse_compressed_position("/5L!!<*e7OS]S")

    assert lat == 49.5
    assert lng == -72.750004
    assert alt == 10004.52

    assert fix == CompressionFix.OLD
    assert source == CompressionSource.OTHER
    assert origin == CompressionOrigin.COMPRESSED
Beispiel #2
0
def test_parse_compressed_position_without_altitude():

    (lat, lng, alt, course, speed, radio_range, fix, source,
     origin) = PositionPacket._parse_compressed_position("/5L!!<*e7> sT")

    assert lat == 49.5
    assert lng == -72.750004
    assert alt is None

    assert fix is None
    assert source is None
    assert origin is None
Beispiel #3
0
def test_parse_compressed_position_with_radio_range():

    (lat, lng, alt, course, speed, radio_range, fix, source,
     origin) = PositionPacket._parse_compressed_position("/5L!!<*e7>{?!")

    assert lat == 49.5
    assert lng == -72.750004
    assert radio_range == 20.13

    assert fix == CompressionFix.CURRENT
    assert source == CompressionSource.GLL
    assert origin == CompressionOrigin.TNC_BTEXT