Example #1
0
 def test_flight_plan(self, stdout):
     locations = NumberedPoints(['52.015;-0.221', '52.168;0.040',
                                '52.249;0.130', '52.494;0.654'])
     locations.flight_plan(0, 'h')
     expect(stdout.getvalue()) == (
         'WAYPOINT,BEARING[°],DISTANCE[km],ELAPSED_TIME[h],LATITUDE[d.dd],LONGITUDE[d.dd]\n'
         '1,,,,52.015000,-0.221000\n'
         '2,46,24.6,,52.168000,0.040000\n'
         '3,34,10.9,,52.249000,0.130000\n'
         '4,52,44.8,,52.494000,0.654000\n'
         '-- OVERALL --#,,80.3,,,\n'
         '-- DIRECT --#,47,79.9,,,\n'
     )
Example #2
0
 def test_flight_plan_minute(self, stdout):
     locations = NumberedPoints(['52.015;-0.221', '52.168;0.040',
                                 '52.249;0.130', '52.494;0.654'],
                                units='nm')
     locations.flight_plan(20, 'm')
     expect(stdout.getvalue()) == (
         'WAYPOINT,BEARING[°],DISTANCE[nm],ELAPSED_TIME[m],LATITUDE[d.dd],LONGITUDE[d.dd]\n'
         '1,,,,52.015000,-0.221000\n'
         '2,46,13.3,0.7,52.168000,0.040000\n'
         '3,34,5.9,0.3,52.249000,0.130000\n'
         '4,52,24.2,1.2,52.494000,0.654000\n'
         '-- OVERALL --,,43.4,2.2,,\n'
         '-- DIRECT --,47,43.1,2.2,,\n'
     )
Example #3
0
 def test_flight_plan(self, capsys):
     locations = NumberedPoints(['52.015;-0.221', '52.168;0.040',
                                 '52.249;0.130', '52.494;0.654'])
     locations.flight_plan(0, 'h')
     if PY2:
         output = capsys.readouterr()[0].encode('utf-8')
     else:
         output = capsys.readouterr()[0]
     assert output == (
         'WAYPOINT,BEARING[°],DISTANCE[km],ELAPSED_TIME[h],LATITUDE[d.dd],LONGITUDE[d.dd]\n'
         '1,,,,52.015000,-0.221000\n'
         '2,46,24.6,,52.168000,0.040000\n'
         '3,34,10.9,,52.249000,0.130000\n'
         '4,52,44.8,,52.494000,0.654000\n'
         '-- OVERALL --#,,80.3,,,\n'
         '-- DIRECT --#,47,79.9,,,\n'
     )
Example #4
0
 def test_flight_plan_minute(self, capsys):
     locations = NumberedPoints(['52.015;-0.221', '52.168;0.040',
                                 '52.249;0.130', '52.494;0.654'],
                                units='nm')
     locations.flight_plan(20, 'm')
     if PY2:
         output = capsys.readouterr()[0].encode('utf-8')
     else:
         output = capsys.readouterr()[0]
     assert output == (
         'WAYPOINT,BEARING[°],DISTANCE[nm],ELAPSED_TIME[m],LATITUDE[d.dd],LONGITUDE[d.dd]\n'
         '1,,,,52.015000,-0.221000\n'
         '2,46,13.3,0.7,52.168000,0.040000\n'
         '3,34,5.9,0.3,52.249000,0.130000\n'
         '4,52,24.2,1.2,52.494000,0.654000\n'
         '-- OVERALL --,,43.4,2.2,,\n'
         '-- DIRECT --,47,43.1,2.2,,\n'
     )