Example #1
0
 def test_decode_vis_single_km_isnt_pluralized(self):
     val = "1KM"
     decoder = MetarDecoderNZ()
     decoder.decode_vis(val)
     res = decoder.decoded_metar["vis"][self.DECODED_KEY]
     assert_equals(res, "1 kilometre")
Example #2
0
 def test_decode_vis_CAVOK(self):
     val = "CAVOK"
     decoder = MetarDecoderNZ()
     decoder.decode_vis(val)
     res = decoder.decoded_metar["vis"][self.DECODED_KEY]
     assert_equals(res, "10 kilometres or more (Ceiling And Visibility OK)")
Example #3
0
 def test_decode_vis_not_reported(self):
     val = "////"
     decoder = MetarDecoderNZ()
     decoder.decode_vis(val)
     res = decoder.decoded_metar["vis"][self.DECODED_KEY]
     assert_equals(res, "not reported (possibly due to a faulty sensor)")
Example #4
0
 def test_decode_vis_kilometres(self):
     val = "29KM"
     decoder = MetarDecoderNZ()
     decoder.decode_vis(val)
     res = decoder.decoded_metar["vis"][self.DECODED_KEY]
     assert_equals(res, "29 kilometres")
Example #5
0
 def test_decode_vis_9999(self):
     val = "9999"
     decoder = MetarDecoderNZ()
     decoder.decode_vis(val)
     res = decoder.decoded_metar["vis"][self.DECODED_KEY]
     assert_equals(res, "10 kilometres or more")
 def test_decode_vis_single_km_isnt_pluralized(self):
   val = "1KM"
   decoder = MetarDecoderNZ()
   decoder.decode_vis(val)
   res = decoder.decoded_metar["vis"][self.DECODED_KEY]
   assert_equals(res, "1 kilometre")
Example #7
0
 def test_decode_vis_less_than_10km(self):
     val = "7000"
     decoder = MetarDecoderNZ()
     decoder.decode_vis(val)
     res = decoder.decoded_metar["vis"][self.DECODED_KEY]
     assert_equals(res, "7,000 metres")
 def test_decode_vis_not_reported(self):
   val = "////"
   decoder = MetarDecoderNZ()
   decoder.decode_vis(val)
   res = decoder.decoded_metar["vis"][self.DECODED_KEY]
   assert_equals(res, "not reported (possibly due to a faulty sensor)")
 def test_decode_vis_CAVOK(self):
   val = "CAVOK"
   decoder = MetarDecoderNZ()
   decoder.decode_vis(val)
   res = decoder.decoded_metar["vis"][self.DECODED_KEY]
   assert_equals(res, "10 kilometres or more (Ceiling And Visibility OK)")
 def test_decode_vis_9999(self):
   val = "9999"
   decoder = MetarDecoderNZ()
   decoder.decode_vis(val)
   res = decoder.decoded_metar["vis"][self.DECODED_KEY]
   assert_equals(res, "10 kilometres or more")
 def test_decode_vis_kilometres(self):
   val = "29KM"
   decoder = MetarDecoderNZ()
   decoder.decode_vis(val)
   res = decoder.decoded_metar["vis"][self.DECODED_KEY]
   assert_equals(res, "29 kilometres")
 def test_decode_vis_less_than_10km(self):
   val = "7000"
   decoder = MetarDecoderNZ()
   decoder.decode_vis(val)
   res = decoder.decoded_metar["vis"][self.DECODED_KEY]
   assert_equals(res, "7,000 metres")