python-ogn-client/tests/parser/test_parse_skylines.py

17 wiersze
451 B
Python
Czysty Zwykły widok Historia

2018-03-10 08:15:09 +00:00
import unittest
2018-04-30 19:00:08 +00:00
from ogn.parser.utils import FPM_TO_MS
2018-03-10 08:15:09 +00:00
from ogn.parser.aprs_comment.skylines_parser import SkylinesParser
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 = SkylinesParser().parse_position("id2816 -015fpm")
2018-03-10 08:15:09 +00:00
2018-04-28 19:31:50 +00:00
self.assertEqual(message['address'], "2816")
2018-04-30 19:00:08 +00:00
self.assertAlmostEqual(message['climb_rate'], -15 * FPM_TO_MS, 2)
2018-03-10 08:15:09 +00:00
if __name__ == '__main__':
unittest.main()