Exemple #1
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"
Exemple #2
0
def test_invalid_bulletin_id_value():
    m = MessagePacket()

    # Bulletin ID must be between 0 and 9 inclusive
    with pytest.raises(ValueError):
        m.bulletin_id = 10
Exemple #3
0
def test_invalid_bulletin_id_type():
    m = MessagePacket()

    # Bulletin ID must be an int
    with pytest.raises(TypeError):
        m.bulletin_id = "1"