Beispiel #1
0
def test_generate_invalid_message():
    m = MessagePacket()
    m.source = "XX1XX-11"
    m.destination = "APRS"
    m.path = "TCPIP*,qAR,T2TEST"

    with pytest.raises(GenerateError):
        m.info
Beispiel #2
0
def test_generate_missing_message():
    m = MessagePacket()
    m.source = "XX1XX-11"
    m.destination = "APRS"
    m.path = "TCPIP*,qAR,T2TEST"
    m.addressee = "YY1YY-12"

    with pytest.raises(GenerateError):
        m.info
Beispiel #3
0
def test_generate_announcement():
    m = MessagePacket()
    m.source = "XX1XX-11"
    m.destination = "APRS"
    m.path = "TCPIP*,qAR,T2TEST"
    m.announcement_id = "A"
    m.message = "This is a test announcement"

    assert m.info == "BLNA     :This is a test announcement"
Beispiel #4
0
def test_generate_bulletin():
    m = MessagePacket()
    m.source = "XX1XX-11"
    m.destination = "APRS"
    m.path = "TCPIP*,qAR,T2TEST"
    m.bulletin_id = 1
    m.message = "This is a test bulletin"

    assert m.info == "BLN1     :This is a test bulletin"
Beispiel #5
0
def test_generate_message():
    m = MessagePacket()
    m.source = "XX1XX-11"
    m.destination = "APRS"
    m.path = "TCPIP*,qAR,T2TEST"
    m.addressee = "YY1YY-12"
    m.message = "This is a test message"

    assert m.info == "YY1YY-12 :This is a test message"
Beispiel #6
0
def test_repr_with_source_only():
    packet = MessagePacket()
    packet.source = "YY1YY-12"

    assert repr(packet) == "<MessagePacket: YY1YY-12>"