2017-10-04 21:23:41 +00:00
|
|
|
import unittest
|
|
|
|
|
2018-04-30 19:00:08 +00:00
|
|
|
from ogn.parser.utils import FPM_TO_MS
|
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):
|
2018-04-20 16:52:00 +00:00
|
|
|
def test_position_comment(self):
|
2019-06-03 19:09:57 +00:00
|
|
|
message = LT24Parser().parse_position("id25387 +123fpm GPS")
|
2017-10-04 21:23:41 +00:00
|
|
|
|
2025-04-23 08:32:54 +00:00
|
|
|
assert message['lt24_id'] == "25387"
|
2018-04-30 19:00:08 +00:00
|
|
|
self.assertAlmostEqual(message['climb_rate'], 123 * FPM_TO_MS, 2)
|
2025-04-23 08:32:54 +00:00
|
|
|
assert message['source'] == 'GPS'
|
2017-10-04 21:23:41 +00:00
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
unittest.main()
|