2017-10-04 21:23:41 +00:00
|
|
|
import unittest
|
|
|
|
|
|
|
|
from ogn.parser.utils import ms2fpm
|
2017-10-05 08:36:53 +00:00
|
|
|
from ogn.parser.aprs_comment.lt24_parser import LT24Parser
|
2017-10-04 21:23:41 +00:00
|
|
|
|
|
|
|
|
|
|
|
class TestStringMethods(unittest.TestCase):
|
|
|
|
def test(self):
|
2017-10-05 08:36:53 +00:00
|
|
|
message = LT24Parser.parse_position("id25387 +000fpm GPS")
|
2017-10-04 21:23:41 +00:00
|
|
|
|
2018-03-10 07:58:32 +00:00
|
|
|
self.assertEqual(message['id'], "25387")
|
2017-10-04 21:23:41 +00:00
|
|
|
self.assertAlmostEqual(message['climb_rate'] * ms2fpm, 0, 2)
|
2018-03-10 07:58:32 +00:00
|
|
|
self.assertEqual(message['source'], 'GPS')
|
2017-10-04 21:23:41 +00:00
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
unittest.main()
|