def test_parse_rvr_missing(self): ### If the RVR is missing, the MetarParser's 'rvr' field should ### remain unset and nothing stripped from the METAR parser = MetarParserDefault() tokens = 'VRB005 -RA BR'.split() res = parser.parse_rvr(tokens) assert_equals(parser.parsed_metar["rvr"], '') assert_equals(res, ['VRB005', '-RA', 'BR'])
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(self): parser = MetarParserDefault() tokens = 'R11/P6000FT -RA BR'.split() res = parser.parse_rvr(tokens) assert_equals(parser.parsed_metar["rvr"], 'R11/P6000FT') assert_equals(res, ['-RA', 'BR'])