Tests for OGFLR, OGNTRK and OGNSDR

pull/31/head
Konstantin Gründger 2017-09-28 22:30:06 +02:00
rodzic 4f1f6c09ae
commit 6044e58773
2 zmienionych plików z 14 dodań i 1 usunięć

Wyświetl plik

@ -140,7 +140,7 @@ def parse_ogn_beacon(aprs_comment, dstcall="APRS"):
return rc_data
raise OgnParseError(aprs_comment)
elif dstcall == "OGNFLR":
elif dstcall == "OGFLR":
ac_data = parse_ogn_aircraft_beacon(aprs_comment)
ac_data.update({'beacon_type': 'aircraft_beacon'})
return ac_data
@ -148,6 +148,10 @@ def parse_ogn_beacon(aprs_comment, dstcall="APRS"):
ac_data = parse_ogn_aircraft_beacon(aprs_comment)
ac_data.update({'beacon_type': 'aircraft_beacon'})
return ac_data
elif dstcall == "OGNSDR":
ac_data = parse_ogn_receiver_beacon(aprs_comment)
ac_data.update({'beacon_type': 'receiver_beacon'})
return ac_data
elif dstcall == "OGLT24":
ac_data = parse_lt24_beacon(aprs_comment)
ac_data.update({'beacon_type': 'lt24_beacon'})

Wyświetl plik

@ -26,6 +26,15 @@ class TestStringMethods(unittest.TestCase):
def test_aprs_receiver_beacons(self):
self.parse_valid_beacon_data_file(filename='aprs_receiver.txt', beacon_type='receiver_beacon')
def test_ogn_flarm_beacons(self):
self.parse_valid_beacon_data_file(filename='ogn_flarm.txt', beacon_type='aircraft_beacon')
def test_ogn_receiver_beacons(self):
self.parse_valid_beacon_data_file(filename='ogn_receiver.txt', beacon_type='receiver_beacon')
def test_ogn_tracker_beacons(self):
self.parse_valid_beacon_data_file(filename='ogn_tracker.txt', beacon_type='aircraft_beacon')
def test_lt24_beacons(self):
self.parse_valid_beacon_data_file(filename='lt24.txt', beacon_type='lt24_beacon')