Exemple #1
0
 def test_parse_metar_without_sky_cond_token(self):
     metar = 'METAR KCVO 010755Z 17007KT 10SM 05/03 A3041 RMK AO1'
     parser = MetarParserDefault()
     res = parser.parse_tokens(metar.split())
     assert_equals(parser.parsed_metar["vis"], '10SM')
     assert_equals(parser.parsed_metar["sky_condition"], [])
     assert_equals(parser.parsed_metar["temp"], '05')
     assert_equals(parser.parsed_metar["dewpoint"], '03')
 def test_parse_metar_without_sky_cond_token(self):
   metar = 'METAR KCVO 010755Z 17007KT 10SM 05/03 A3041 RMK AO1'
   parser = MetarParserDefault()
   res = parser.parse_tokens(metar.split())
   assert_equals(parser.parsed_metar["vis"], '10SM')
   assert_equals(parser.parsed_metar["sky_condition"], [])
   assert_equals(parser.parsed_metar["temp"], '05')
   assert_equals(parser.parsed_metar["dewpoint"], '03')
 def test_parse_metar_khio(self):
   metar = 'METAR KHIO 290653Z AUTO 00000KT 10SM FEW032 OVC041 06/05 ' \
           'A3017 RMK AO2 RAB35E44 SLP219 P0000 T00560050'
   parser = MetarParserDefault()
   res = parser.parse_tokens(metar.split())
   assert_equals(parser.parsed_metar["is_special_report"], False)
   assert_equals(parser.parsed_metar["icao_id"], 'KHIO')
   assert_equals(parser.parsed_metar["obs_datetime"], '290653Z')
   assert_equals(parser.parsed_metar["mod_auto"], True)
   assert_equals(parser.parsed_metar["wind_dir_speed"], '00000KT')
   assert_equals(parser.parsed_metar["vis"], '10SM')
   assert_equals(parser.parsed_metar["wx_phenomena"], [])
   assert_equals(parser.parsed_metar["sky_condition"], ['FEW032', 'OVC041'])
   assert_equals(parser.parsed_metar["temp"], '06')
   assert_equals(parser.parsed_metar["dewpoint"], '05')
   assert_equals(parser.parsed_metar["altimeter"], '3017')
   assert_equals(parser.parsed_metar["stn_type"], 'AO2')
   assert_equals(parser.parsed_metar["sea_level_pressure"], 'SLP219')
   assert_equals(parser.parsed_metar["hourly_temp_dewpoint"], 'T00560050')
   assert_equals(parser.parsed_metar["remarks"], 'RAB35E44 P0000')
   assert_equals(parser.parsed_metar["misc"], '')
Exemple #4
0
 def test_parse_metar_khio(self):
     metar = 'METAR KHIO 290653Z AUTO 00000KT 10SM FEW032 OVC041 06/05 ' \
             'A3017 RMK AO2 RAB35E44 SLP219 P0000 T00560050'
     parser = MetarParserDefault()
     res = parser.parse_tokens(metar.split())
     assert_equals(parser.parsed_metar["is_special_report"], False)
     assert_equals(parser.parsed_metar["icao_id"], 'KHIO')
     assert_equals(parser.parsed_metar["obs_datetime"], '290653Z')
     assert_equals(parser.parsed_metar["mod_auto"], True)
     assert_equals(parser.parsed_metar["wind_dir_speed"], '00000KT')
     assert_equals(parser.parsed_metar["vis"], '10SM')
     assert_equals(parser.parsed_metar["wx_phenomena"], [])
     assert_equals(parser.parsed_metar["sky_condition"],
                   ['FEW032', 'OVC041'])
     assert_equals(parser.parsed_metar["temp"], '06')
     assert_equals(parser.parsed_metar["dewpoint"], '05')
     assert_equals(parser.parsed_metar["altimeter"], '3017')
     assert_equals(parser.parsed_metar["stn_type"], 'AO2')
     assert_equals(parser.parsed_metar["sea_level_pressure"], 'SLP219')
     assert_equals(parser.parsed_metar["hourly_temp_dewpoint"], 'T00560050')
     assert_equals(parser.parsed_metar["remarks"], 'RAB35E44 P0000')
     assert_equals(parser.parsed_metar["misc"], '')