kopia lustrzana https://github.com/glidernet/python-ogn-client
Regex patterns are more tolerant, so remove the „incomplete xy“ tests
Remove unused importspull/23/head
rodzic
c98c8eca04
commit
44cc855d6c
|
@ -5,7 +5,7 @@ from datetime import datetime
|
||||||
from time import sleep
|
from time import sleep
|
||||||
|
|
||||||
from ogn.parser.parse import parse_aprs, parse_ogn_beacon
|
from ogn.parser.parse import parse_aprs, parse_ogn_beacon
|
||||||
from ogn.parser.exceptions import AprsParseError, OgnParseError
|
from ogn.parser.exceptions import AprsParseError
|
||||||
|
|
||||||
|
|
||||||
class TestStringMethods(unittest.TestCase):
|
class TestStringMethods(unittest.TestCase):
|
||||||
|
@ -29,18 +29,6 @@ class TestStringMethods(unittest.TestCase):
|
||||||
with self.assertRaises(AprsParseError):
|
with self.assertRaises(AprsParseError):
|
||||||
parse_aprs("Lachens>APRS,TCPIwontbeavalidstring")
|
parse_aprs("Lachens>APRS,TCPIwontbeavalidstring")
|
||||||
|
|
||||||
def test_incomplete_device_string(self):
|
|
||||||
with self.assertRaises(OgnParseError):
|
|
||||||
aprs = parse_aprs("ICA4B0E3A>APRS,qAS,Letzi:/072319h4711.75N\\00802.59E^327/149/A=006498 id154B0E3A -395",
|
|
||||||
datetime(2015, 4, 10, 7, 24))
|
|
||||||
parse_ogn_beacon(aprs['comment'])
|
|
||||||
|
|
||||||
def test_incomplete_receiver_string(self):
|
|
||||||
with self.assertRaises(OgnParseError):
|
|
||||||
aprs = parse_aprs("Lachens>APRS,TCPIP*,qAC,GLIDERN2:/165334h4344.70NI00639.19E&/A=005435 v0.2.1 CPU:0.3 RAM:1764.4/21",
|
|
||||||
datetime(2015, 4, 10, 16, 54))
|
|
||||||
parse_ogn_beacon(aprs['comment'])
|
|
||||||
|
|
||||||
@mock.patch('ogn.parser.parse.createTimestamp')
|
@mock.patch('ogn.parser.parse.createTimestamp')
|
||||||
def test_default_reference_date(self, createTimestamp_mock):
|
def test_default_reference_date(self, createTimestamp_mock):
|
||||||
valid_aprs_string = "Lachens>APRS,TCPIP*,qAC,GLIDERN2:/165334h4344.70NI00639.19E&/A=005435 v0.2.1 CPU:0.3 RAM:1764.4/21"
|
valid_aprs_string = "Lachens>APRS,TCPIP*,qAC,GLIDERN2:/165334h4344.70NI00639.19E&/A=005435 v0.2.1 CPU:0.3 RAM:1764.4/21"
|
||||||
|
|
Ładowanie…
Reference in New Issue