def test_decode_wx_phenomena_tornado_waterspout_special_case(self): # +FC is a special case for tornadoes and waterspouts - the # modifier '+' should be ignored. val = ["+FC"] decoder = MetarDecoderNZ() decoder.decode_wx_phenomena(val) res = decoder.decoded_metar["wx_phenomena"][self.DECODED_KEY] assert_equals(res, ["funnel cloud (tornado or waterspout)"])
def test_decode_wx_phenomena_tornado_waterspout_special_case(self): # +FC is a special case for tornadoes and waterspouts - the # modifier '+' should be ignored. val = ["+FC"] decoder = MetarDecoderNZ() decoder.decode_wx_phenomena(val) res = decoder.decoded_metar["wx_phenomena"][self.DECODED_KEY] assert_equals(res, ["funnel cloud (tornado or waterspout)"])
def test_decode_wx_phenomena_modifiers(self): decoder = MetarDecoderNZ() # Light val = ["-PY"] decoder.decode_wx_phenomena(val) res = decoder.decoded_metar["wx_phenomena"][self.DECODED_KEY] assert_equals(res, ["light spray"]) # Moderate val = ["PY"] decoder.decode_wx_phenomena(val) res = decoder.decoded_metar["wx_phenomena"][self.DECODED_KEY] assert_equals(res, ["moderate spray"]) # Heavy val = ["+PY"] decoder.decode_wx_phenomena(val) res = decoder.decoded_metar["wx_phenomena"][self.DECODED_KEY] assert_equals(res, ["heavy spray"])
def test_decode_wx_phenomena_modifiers(self): decoder = MetarDecoderNZ() # Light val = ["-PY"] decoder.decode_wx_phenomena(val) res = decoder.decoded_metar["wx_phenomena"][self.DECODED_KEY] assert_equals(res, ["light spray"]) # Moderate val = ["PY"] decoder.decode_wx_phenomena(val) res = decoder.decoded_metar["wx_phenomena"][self.DECODED_KEY] assert_equals(res, ["moderate spray"]) # Heavy val = ["+PY"] decoder.decode_wx_phenomena(val) res = decoder.decoded_metar["wx_phenomena"][self.DECODED_KEY] assert_equals(res, ["heavy spray"])
def test_decode_wx_phenomena_multiple_values(self): val = ["-SHRA", "+BR"] decoder = MetarDecoderNZ() decoder.decode_wx_phenomena(val) res = decoder.decoded_metar["wx_phenomena"][self.DECODED_KEY] assert_equals(res, ["light showers of rain", "heavy mist"])
def test_decode_wx_phenomena_in_the_vicinity(self): val = ["VCFG"] decoder = MetarDecoderNZ() decoder.decode_wx_phenomena(val) res = decoder.decoded_metar["wx_phenomena"][self.DECODED_KEY] assert_equals(res, ["fog in the vicinity"])
def test_decode_wx_phenomena_sensor_inop(self): val = "//" decoder = MetarDecoderNZ() decoder.decode_wx_phenomena(val) res = decoder.decoded_metar["wx_phenomena"][self.DECODED_KEY] assert_equals(res, "none reported, sensor temporarily inoperative")
def test_decode_wx_phenomena_basic(self): val = ["SHRA"] decoder = MetarDecoderNZ() decoder.decode_wx_phenomena(val) res = decoder.decoded_metar["wx_phenomena"][self.DECODED_KEY] assert_equals(res, ["moderate showers of rain"])
def test_decode_wx_phenomena_multiple_values(self): val = ["-SHRA", "+BR"] decoder = MetarDecoderNZ() decoder.decode_wx_phenomena(val) res = decoder.decoded_metar["wx_phenomena"][self.DECODED_KEY] assert_equals(res, ["light showers of rain", "heavy mist"])
def test_decode_wx_phenomena_in_the_vicinity(self): val = ["VCFG"] decoder = MetarDecoderNZ() decoder.decode_wx_phenomena(val) res = decoder.decoded_metar["wx_phenomena"][self.DECODED_KEY] assert_equals(res, ["fog in the vicinity"])
def test_decode_wx_phenomena_sensor_inop(self): val = "//" decoder = MetarDecoderNZ() decoder.decode_wx_phenomena(val) res = decoder.decoded_metar["wx_phenomena"][self.DECODED_KEY] assert_equals(res, "none reported, sensor temporarily inoperative")
def test_decode_wx_phenomena_basic(self): val = ["SHRA"] decoder = MetarDecoderNZ() decoder.decode_wx_phenomena(val) res = decoder.decoded_metar["wx_phenomena"][self.DECODED_KEY] assert_equals(res, ["moderate showers of rain"])