def test_decode_wind_light_variable(self): val = "VRB004KT" decoder = MetarDecoderDefault() decoder.decode_wind_dir_speed(val) res = decoder.decoded_metar["wind_dir_speed"][self.DECODED_KEY] assert_equals(res, "variable, at 4 knots")
def test_decode_wind_speed_calm(self): val = "00000KT" decoder = MetarDecoderDefault() decoder.decode_wind_dir_speed(val) res = decoder.decoded_metar["wind_dir_speed"][self.DECODED_KEY] assert_equals(res, "calm winds")
def test_decode_wind_single_knot_speed_isnt_pluralized(self): val = "02001KT" decoder = MetarDecoderDefault() decoder.decode_wind_dir_speed(val) res = decoder.decoded_metar["wind_dir_speed"][self.DECODED_KEY] assert_equals(res, "from 020 degrees, at 1 knot")
def test_decode_wind_dir_speed_basic(self): val = "11013KT" decoder = MetarDecoderDefault() decoder.decode_wind_dir_speed(val) res = decoder.decoded_metar["wind_dir_speed"][self.DECODED_KEY] assert_equals(res, "from 110 degrees, at 13 knots")
def test_decode_wind_dir_speed_with_gusts(self): val = "18014G18KT" decoder = MetarDecoderDefault() decoder.decode_wind_dir_speed(val) res = decoder.decoded_metar["wind_dir_speed"][self.DECODED_KEY] assert_equals(res, "from 180 degrees, at 14 knots gusting to 18 knots")
def test_decode_wind_light_variable(self): val = "VRB004KT" decoder = MetarDecoderDefault() decoder.decode_wind_dir_speed(val) res = decoder.decoded_metar["wind_dir_speed"][self.DECODED_KEY] assert_equals(res, "variable, at 4 knots")
def test_decode_wind_light_variable_single_knot_isnt_pluralized(self): val = "VRB001KT" decoder = MetarDecoderDefault() decoder.decode_wind_dir_speed(val) res = decoder.decoded_metar["wind_dir_speed"][self.DECODED_KEY] assert_equals(res, "variable, at 1 knot")
def test_decode_wind_single_knot_speed_isnt_pluralized(self): val = "02001KT" decoder = MetarDecoderDefault() decoder.decode_wind_dir_speed(val) res = decoder.decoded_metar["wind_dir_speed"][self.DECODED_KEY] assert_equals(res, "from 020 degrees, at 1 knot")
def test_decode_wind_speed_calm(self): val = "00000KT" decoder = MetarDecoderDefault() decoder.decode_wind_dir_speed(val) res = decoder.decoded_metar["wind_dir_speed"][self.DECODED_KEY] assert_equals(res, "calm winds")
def test_decode_wind_dir_speed_with_gusts(self): val = "18014G18KT" decoder = MetarDecoderDefault() decoder.decode_wind_dir_speed(val) res = decoder.decoded_metar["wind_dir_speed"][self.DECODED_KEY] assert_equals(res, "from 180 degrees, at 14 knots gusting to 18 knots")
def test_decode_wind_dir_speed_basic(self): val = "11013KT" decoder = MetarDecoderDefault() decoder.decode_wind_dir_speed(val) res = decoder.decoded_metar["wind_dir_speed"][self.DECODED_KEY] assert_equals(res, "from 110 degrees, at 13 knots")
def test_decode_wind_light_variable_single_knot_isnt_pluralized(self): val = "VRB001KT" decoder = MetarDecoderDefault() decoder.decode_wind_dir_speed(val) res = decoder.decoded_metar["wind_dir_speed"][self.DECODED_KEY] assert_equals(res, "variable, at 1 knot")