def test_taf_line(self): """ Tests converting TAF line data into into a single spoken string """ units = structs.Units(**static.NA_UNITS) line = { 'altimeter': core.make_number('2992'), 'clouds': [core.make_cloud('BKN015CB')], 'end_time': core.make_timestamp('1206'), 'icing': ['611005'], 'other': ['+RA'], 'start_time': core.make_timestamp('1202'), 'turbulance': ['540553'], 'type': 'FROM', 'visibility': core.make_number('3'), 'wind_direction': core.make_number('360'), 'wind_gust': core.make_number('20'), 'wind_shear': 'WS020/07040KT', 'wind_speed': core.make_number('12'), } line.update({k: None for k in ('flight_rules', 'probability', 'raw', 'sanitized')}) line = structs.TafLineData(**line) spoken = ('From 2 to 6 zulu, Winds three six zero at 12kt gusting to 20kt. ' 'Wind shear 2000inHg from zero seven zero at 40kt. Visibility three miles. ' 'Altimeter two nine point nine two. Heavy Rain. ' 'Broken layer at 1500ft (Cumulonimbus). ' 'Occasional moderate turbulence in clouds from 5500ft to 8500ft. ' 'Light icing from 10000ft to 15000ft') ret = speech.taf_line(line, units) self.assertIsInstance(ret, str) self.assertEqual(ret, spoken)
def test_taf_line(self): """ Tests converting TAF line data into into a single spoken string """ units = structs.Units(**static.NA_UNITS) line = { "altimeter": _core.make_number("2992"), "clouds": [_core.make_cloud("BKN015CB")], "end_time": _core.make_timestamp("1206"), "icing": ["611005"], "other": ["+RA"], "start_time": _core.make_timestamp("1202"), "turbulence": ["540553"], "type": "FROM", "visibility": _core.make_number("3"), "wind_direction": _core.make_number("360"), "wind_gust": _core.make_number("20"), "wind_shear": "WS020/07040KT", "wind_speed": _core.make_number("12"), } line.update( {k: None for k in ("flight_rules", "probability", "raw", "sanitized")} ) line = structs.TafLineData(**line) spoken = ( "From 2 to 6 zulu, Winds three six zero at 12kt gusting to 20kt. " "Wind shear 2000inHg from zero seven zero at 40kt. Visibility three miles. " "Altimeter two nine point nine two. Heavy Rain. " "Broken layer at 1500ft (Cumulonimbus). " "Occasional moderate turbulence in clouds from 5500ft to 8500ft. " "Light icing from 10000ft to 15000ft" ) ret = speech.taf_line(line, units) self.assertIsInstance(ret, str) self.assertEqual(ret, spoken)
def test_taf_line(self): """ Tests converting TAF line data into into a single spoken string """ units = structs.Units(**static.NA_UNITS) line = { 'altimeter': core.make_number('2992'), 'clouds': [core.make_cloud('BKN015CB')], 'end_time': core.make_timestamp('1206'), 'icing': ['611005'], 'other': ['+RA'], 'start_time': core.make_timestamp('1202'), 'turbulance': ['540553'], 'type': 'FROM', 'visibility': core.make_number('3'), 'wind_direction': core.make_number('360'), 'wind_gust': core.make_number('20'), 'wind_shear': 'WS020/07040KT', 'wind_speed': core.make_number('12'), } line.update({ k: None for k in ('flight_rules', 'probability', 'raw', 'sanitized') }) line = structs.TafLineData(**line) spoken = ( 'From 2 to 6 zulu, Winds three six zero at 12kt gusting to 20kt. ' 'Wind shear 2000inHg from zero seven zero at 40kt. Visibility three miles. ' 'Altimeter two nine point nine two. Heavy Rain. ' 'Broken layer at 1500ft (Cumulonimbus). ' 'Occasional moderate turbulence in clouds from 5500ft to 8500ft. ' 'Light icing from 10000ft to 15000ft') ret = speech.taf_line(line, units) self.assertIsInstance(ret, str) self.assertEqual(ret, spoken)