kopia lustrzana https://github.com/glidernet/python-ogn-client
Empty APRS comment belongs to a receiver beacon
rodzic
5b131855a3
commit
36ce45fe20
|
@ -90,6 +90,9 @@ def parse_ogn_receiver_beacon(aprs_comment):
|
|||
|
||||
|
||||
def parse_ogn_beacon(aprs_comment):
|
||||
if not aprs_comment:
|
||||
return {'beacon_type': 'receiver_beacon'}
|
||||
|
||||
ac_data = parse_ogn_aircraft_beacon(aprs_comment)
|
||||
if ac_data:
|
||||
ac_data.update({'beacon_type': 'aircraft_beacon'})
|
||||
|
|
|
@ -17,10 +17,13 @@ class TestStringMethods(unittest.TestCase):
|
|||
if aprs['comment']:
|
||||
parse_ogn_beacon(aprs['comment'])
|
||||
|
||||
def test_fail_none(self):
|
||||
def test_fail_parse_aprs_none(self):
|
||||
with self.assertRaises(TypeError):
|
||||
parse_aprs(None)
|
||||
|
||||
def test_parse_ogn_none(self):
|
||||
parse_ogn_beacon(None)
|
||||
|
||||
def test_fail_empty(self):
|
||||
with self.assertRaises(AprsParseError):
|
||||
parse_aprs("")
|
||||
|
|
Ładowanie…
Reference in New Issue