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