Пример #1
0
def test_generate_compressed(latitude, longitude, timestamp, timestamp_type, messaging,
                             expected_output):
    p = PositionPacket()

    p.source = "XX1XX"
    p.destination = "APRS"
    p.path = "TCPIP"

    p.symbol_table = "/"
    p.symbol_id = "k"

    p.latitude = latitude
    p.longitude = longitude

    p.timestamp = timestamp
    p.timestamp_type = timestamp_type

    p.messaging = messaging
    p.comment = "Test comment"
    p.compressed = True

    output = p.generate()

    assert output == expected_output
Пример #2
0
def test_invalid_compressed_type():
    p = PositionPacket()

    with pytest.raises(TypeError):
        p.compressed = None