def test_decode_dewpoint_negative(self): val = "M04" decoder = MetarDecoderDefault() decoder.decode_dewpoint(val) res = decoder.decoded_metar["dewpoint"][self.DECODED_KEY] degree_sign = u'\N{DEGREE SIGN}' assert_equals(res, "minus 4%sC" % degree_sign)
def test_decode_dewpoint_single_digit_degree_gets_leading_zero_stripped(self): val = "09" decoder = MetarDecoderDefault() decoder.decode_dewpoint(val) res = decoder.decoded_metar["dewpoint"][self.DECODED_KEY] degree_sign = u'\N{DEGREE SIGN}' assert_equals(res, "9%sC" % degree_sign)
def test_decode_dewpoint_negative(self): val = "M04" decoder = MetarDecoderDefault() decoder.decode_dewpoint(val) res = decoder.decoded_metar["dewpoint"][self.DECODED_KEY] degree_sign = u'\N{DEGREE SIGN}' assert_equals(res, "minus 4%sC" % degree_sign)
def test_decode_dewpoint_single_digit_degree_gets_leading_zero_stripped( self): val = "09" decoder = MetarDecoderDefault() decoder.decode_dewpoint(val) res = decoder.decoded_metar["dewpoint"][self.DECODED_KEY] degree_sign = u'\N{DEGREE SIGN}' assert_equals(res, "9%sC" % degree_sign)
def test_decode_dewpoint_missing(self): val = "" decoder = MetarDecoderDefault() decoder.decode_dewpoint(val) res = decoder.decoded_metar["dewpoint"][self.DECODED_KEY] assert_equals(res, "(missing)")
def test_decode_dewpoint_missing(self): val = "" decoder = MetarDecoderDefault() decoder.decode_dewpoint(val) res = decoder.decoded_metar["dewpoint"][self.DECODED_KEY] assert_equals(res, "(missing)")