Esempio n. 1
0
 def test_parse_remarks_invalid_token_similar_to_pressure_rise_fall_rapid_isnt_parsed(
         self):
     parser = MetarParserDefault()
     tokens = 'RMK WSHFT 1715 PRESasdf'.split()
     res = parser.parse_remarks(tokens)
     assert_equals(parser.parsed_metar["pressure_rise_fall_rapid"], '')
     assert_equals(parser.parsed_metar["remarks"], 'PRESasdf')
Esempio n. 2
0
 def test_remarks_ignores_unknown_preceding_tokens(self):
     parser = MetarParserDefault()
     tokens = 'A2990 RANDTOK MISC RMK AO2 PK WND 20032/25 MISC ITEM'.split()
     res = parser.parse_remarks(tokens)
     assert_equals(parser.parsed_metar["remarks"], 'MISC ITEM')
     assert_equals(res, ['A2990', 'RANDTOK', 'MISC'])
Esempio n. 3
0
 def test_remarks_id_present_but_remarks_missing(self):
     parser = MetarParserDefault()
     tokens = 'A2990 RMK'.split()
     res = parser.parse_remarks(tokens)
     assert_equals(parser.parsed_metar["remarks"], '')
     assert_equals(res, ['A2990'])  # Expect the parser to remove 'RMK'
Esempio n. 4
0
 def test_remarks_missing(self):
     parser = MetarParserDefault()
     tokens = 'A2990'.split()
     res = parser.parse_remarks(tokens)
     assert_equals(parser.parsed_metar["remarks"], '')
     assert_equals(res, ['A2990'])
 def test_remarks_missing(self):
   parser = MetarParserDefault()
   tokens = 'A2990'.split()
   res = parser.parse_remarks(tokens)
   assert_equals(parser.parsed_metar["remarks"], '')
   assert_equals(res, ['A2990'])
Esempio n. 6
0
 def test_parse_remarks_with_maint_reqd(self):
     parser = MetarParserDefault()
     tokens = 'RMK WSHFT 1715 PRESFR SLP125 $'.split()
     res = parser.parse_remarks(tokens)
     assert_equals(parser.parsed_metar["maint_reqd"], True)
Esempio n. 7
0
 def test_parse_remarks_with_wind_shift_with_frontal_passage(self):
     parser = MetarParserDefault()
     tokens = 'RMK PK WND 20032/25 WSHFT 1715 FROPA'.split()
     res = parser.parse_remarks(tokens)
     assert_equals(parser.parsed_metar["wind_shift"], 'WSHFT 1715 FROPA')
 def test_parse_remarks_with_pressure_fall_rapid(self):
   parser = MetarParserDefault()
   tokens = 'RMK WSHFT 1715 PRESFR'.split()
   res = parser.parse_remarks(tokens)
   assert_equals(parser.parsed_metar["pressure_rise_fall_rapid"], 'PRESFR')
 def test_parse_remarks_invalid_token_similar_to_pressure_rise_fall_rapid_isnt_parsed(self):
   parser = MetarParserDefault()
   tokens = 'RMK WSHFT 1715 PRESasdf'.split()
   res = parser.parse_remarks(tokens)
   assert_equals(parser.parsed_metar["pressure_rise_fall_rapid"], '')
   assert_equals(parser.parsed_metar["remarks"], 'PRESasdf')
 def test_parse_remarks_with_peak_wind(self):
   parser = MetarParserDefault()
   tokens = 'RMK PK WND 20032/25 WSHFT 1715'.split()
   res = parser.parse_remarks(tokens)
   assert_equals(parser.parsed_metar["peak_wind"], 'PK WND 20032/25')
 def test_parse_remarks_with_wind_shift_with_frontal_passage(self):
   parser = MetarParserDefault()
   tokens = 'RMK PK WND 20032/25 WSHFT 1715 FROPA'.split()
   res = parser.parse_remarks(tokens)
   assert_equals(parser.parsed_metar["wind_shift"], 'WSHFT 1715 FROPA')
 def test_parse_remarks_with_stn_type(self):
   parser = MetarParserDefault()
   tokens = 'RMK AO2'.split()
   res = parser.parse_remarks(tokens)
   assert_equals(parser.parsed_metar["stn_type"], 'AO2')
   assert_equals(parser.parsed_metar["remarks"], '')
 def test_remarks_ignores_unknown_preceding_tokens(self):
   parser = MetarParserDefault()
   tokens = 'A2990 RANDTOK MISC RMK AO2 PK WND 20032/25 MISC ITEM'.split()
   res = parser.parse_remarks(tokens)
   assert_equals(parser.parsed_metar["remarks"], 'MISC ITEM')
   assert_equals(res, ['A2990', 'RANDTOK', 'MISC'])
 def test_remarks_id_present_but_remarks_missing(self):
   parser = MetarParserDefault()
   tokens = 'A2990 RMK'.split()
   res = parser.parse_remarks(tokens)
   assert_equals(parser.parsed_metar["remarks"], '')
   assert_equals(res, ['A2990']) # Expect the parser to remove 'RMK'
Esempio n. 15
0
 def test_parse_remarks_with_stn_type(self):
     parser = MetarParserDefault()
     tokens = 'RMK AO2'.split()
     res = parser.parse_remarks(tokens)
     assert_equals(parser.parsed_metar["stn_type"], 'AO2')
     assert_equals(parser.parsed_metar["remarks"], '')
 def test_parse_remarks_with_sea_level_pressure(self):
   parser = MetarParserDefault()
   tokens = 'RMK WSHFT 1715 PRESFR SLP125'.split()
   res = parser.parse_remarks(tokens)
   assert_equals(parser.parsed_metar["sea_level_pressure"], 'SLP125')
Esempio n. 17
0
 def test_parse_remarks_with_peak_wind(self):
     parser = MetarParserDefault()
     tokens = 'RMK PK WND 20032/25 WSHFT 1715'.split()
     res = parser.parse_remarks(tokens)
     assert_equals(parser.parsed_metar["peak_wind"], 'PK WND 20032/25')
 def test_parse_remarks_with_maint_reqd(self):
   parser = MetarParserDefault()
   tokens = 'RMK WSHFT 1715 PRESFR SLP125 $'.split()
   res = parser.parse_remarks(tokens)
   assert_equals(parser.parsed_metar["maint_reqd"], True)
Esempio n. 19
0
 def test_parse_remarks_with_pressure_fall_rapid(self):
     parser = MetarParserDefault()
     tokens = 'RMK WSHFT 1715 PRESFR'.split()
     res = parser.parse_remarks(tokens)
     assert_equals(parser.parsed_metar["pressure_rise_fall_rapid"],
                   'PRESFR')
 def test_parse_remarks_hourly_temp_dewpoint(self):
   parser = MetarParserDefault()
   tokens = 'RMK AO2 SLP062 T02000106 $'.split()
   res = parser.parse_remarks(tokens)
   assert_equals(parser.parsed_metar["hourly_temp_dewpoint"], "T02000106")
Esempio n. 21
0
 def test_parse_remarks_with_sea_level_pressure(self):
     parser = MetarParserDefault()
     tokens = 'RMK WSHFT 1715 PRESFR SLP125'.split()
     res = parser.parse_remarks(tokens)
     assert_equals(parser.parsed_metar["sea_level_pressure"], 'SLP125')
Esempio n. 22
0
 def test_parse_remarks(self):
     parser = MetarParserDefault()
     tokens = 'RMK AO2 PK WND 20032/25 WSHFT 1715 MISC REMARK'.split()
     res = parser.parse_remarks(tokens)
     assert_equals(parser.parsed_metar["remarks"], 'MISC REMARK')
Esempio n. 23
0
 def test_parse_remarks_hourly_temp_dewpoint(self):
     parser = MetarParserDefault()
     tokens = 'RMK AO2 SLP062 T02000106 $'.split()
     res = parser.parse_remarks(tokens)
     assert_equals(parser.parsed_metar["hourly_temp_dewpoint"], "T02000106")
 def test_parse_remarks(self):
   parser = MetarParserDefault()
   tokens = 'RMK AO2 PK WND 20032/25 WSHFT 1715 MISC REMARK'.split()
   res = parser.parse_remarks(tokens)
   assert_equals(parser.parsed_metar["remarks"], 'MISC REMARK')