Example #1
0
 def test_parse_winds_variable(self):
     parser = MetarParserDefault()
     tokens = '18015KT 150V210 10SM'.split()
     # Make sure both the wind info and direction variation get picked up
     res = parser.parse_wind_dir_speed(tokens)
     res = parser.parse_wind_dir_variation(res)
     assert_equals(parser.parsed_metar["wind_dir_speed"], '18015KT')
     assert_equals(parser.parsed_metar["wind_dir_variation"], '150V210')
 def test_parse_winds_variable(self):
   parser = MetarParserDefault()
   tokens = '18015KT 150V210 10SM'.split()
   # Make sure both the wind info and direction variation get picked up
   res = parser.parse_wind_dir_speed(tokens)
   res = parser.parse_wind_dir_variation(res)
   assert_equals(parser.parsed_metar["wind_dir_speed"], '18015KT')
   assert_equals(parser.parsed_metar["wind_dir_variation"], '150V210')
Example #3
0
 def test_parse_rvr_missing_with_similar_wx_phenomena(self):
     ### The RVR field begins with 'R', but the following WX phenomena
     ### section can also start with 'R' in the case of moderate rain: 'RA'.
     ### This test ensures we don't mis-identify 'RA' as the RVR field.
     parser = MetarParserDefault()
     tokens = '18015KT RA'.split()
     res = parser.parse_wind_dir_speed(tokens)
     res = parser.parse_rvr(res)
     assert_equals(parser.parsed_metar["rvr"], '')
     assert_equals(res, ['RA'])
 def test_parse_rvr_missing_with_similar_wx_phenomena(self):
   ### The RVR field begins with 'R', but the following WX phenomena
   ### section can also start with 'R' in the case of moderate rain: 'RA'.
   ### This test ensures we don't mis-identify 'RA' as the RVR field.
   parser = MetarParserDefault()
   tokens = '18015KT RA'.split()
   res = parser.parse_wind_dir_speed(tokens)
   res = parser.parse_rvr(res)
   assert_equals(parser.parsed_metar["rvr"], '')
   assert_equals(res, ['RA'])
Example #5
0
 def test_parse_winds_variable_missing(self):
     ### If the variable winds section is missing we shouldn't set the
     ### MetarParser's wind_dir_variation field, or strip anything
     parser = MetarParserDefault()
     tokens = '18015KT 10SM'.split()
     # Include the wind_dir_speed parseor for a sanity check
     res = parser.parse_wind_dir_speed(tokens)
     res = parser.parse_wind_dir_variation(res)
     assert_equals(parser.parsed_metar["wind_dir_speed"], '18015KT')
     assert_equals(parser.parsed_metar["wind_dir_variation"], '')
     assert_equals(res, ['10SM'])
 def test_parse_winds_variable_missing(self):
   ### If the variable winds section is missing we shouldn't set the
   ### MetarParser's wind_dir_variation field, or strip anything
   parser = MetarParserDefault()
   tokens = '18015KT 10SM'.split()
   # Include the wind_dir_speed parseor for a sanity check
   res = parser.parse_wind_dir_speed(tokens)
   res = parser.parse_wind_dir_variation(res)
   assert_equals(parser.parsed_metar["wind_dir_speed"], '18015KT')
   assert_equals(parser.parsed_metar["wind_dir_variation"], '')
   assert_equals(res, ['10SM'])
Example #7
0
 def test_parse_winds_light_variable(self):
     parser = MetarParserDefault()
     tokens = 'VRB005KT'.split()
     res = parser.parse_wind_dir_speed(tokens)
     assert_equals(parser.parsed_metar["wind_dir_speed"], 'VRB005KT')
Example #8
0
 def test_parse_winds_calm(self):
     parser = MetarParserDefault()
     tokens = '00000KT 10SM'.split()
     res = parser.parse_wind_dir_speed(tokens)
     assert_equals(parser.parsed_metar["wind_dir_speed"], '00000KT')
     assert_equals(res, ['10SM'])
Example #9
0
 def test_parse_winds_with_gusts(self):
     parser = MetarParserDefault()
     tokens = '21016G24KT 10SM'.split()
     res = parser.parse_wind_dir_speed(tokens)
     assert_equals(parser.parsed_metar["wind_dir_speed"], '21016G24KT')
Example #10
0
 def test_parse_winds_basic(self):
     parser = MetarParserDefault()
     tokens = '18004KT 10SM'.split()
     res = parser.parse_wind_dir_speed(tokens)
     assert_equals(parser.parsed_metar["wind_dir_speed"], '18004KT')
 def test_parse_winds_basic(self):
   parser = MetarParserDefault()
   tokens = '18004KT 10SM'.split()
   res = parser.parse_wind_dir_speed(tokens)
   assert_equals(parser.parsed_metar["wind_dir_speed"], '18004KT')
 def test_parse_winds_light_variable(self):
   parser = MetarParserDefault()
   tokens = 'VRB005KT'.split()
   res = parser.parse_wind_dir_speed(tokens)
   assert_equals(parser.parsed_metar["wind_dir_speed"], 'VRB005KT')
 def test_parse_winds_calm(self):
   parser = MetarParserDefault()
   tokens = '00000KT 10SM'.split()
   res = parser.parse_wind_dir_speed(tokens)
   assert_equals(parser.parsed_metar["wind_dir_speed"], '00000KT')
   assert_equals(res, ['10SM'])
 def test_parse_winds_with_gusts(self):
   parser = MetarParserDefault()
   tokens = '21016G24KT 10SM'.split()
   res = parser.parse_wind_dir_speed(tokens)
   assert_equals(parser.parsed_metar["wind_dir_speed"], '21016G24KT')