def other(wxcodes: [str]) -> str: """ Format wx codes into a spoken word string """ ret = [] for code in wxcodes: item = translate.wxcode(code) if item.startswith('Vicinity'): item = item.lstrip('Vicinity ') + ' in the Vicinity' ret.append(item) return '. '.join(ret)
def other(wxcodes: [str]) -> str: """ Format wx codes into a spoken word string """ ret = [] for code in wxcodes: item = translate.wxcode(code) if item.startswith("Vicinity"): item = item.lstrip("Vicinity ") + " in the Vicinity" ret.append(item) return ". ".join(ret)
def other(wxcodes: [str]) -> str: """ Format wx codes into a spoken word string """ ret = [] for item in wxcodes: item = translate.wxcode(item) if item.startswith('Vicinity'): item = item.lstrip('Vicinity ') + ' in the Vicinity' ret.append(item) return '. '.join(ret)
def test_wxcode(self): """ Tests expenading weather codes or ignoring them """ for code, translation in ( ('', ''), ('R03/03002V03', 'R03/03002V03'), ('+RATS', 'Heavy Rain Thunderstorm'), ('VCFC', 'Vicinity Funnel Cloud'), ('-GR', 'Light Hail'), ('FZFG', 'Freezing Fog'), ('BCBLSN', 'Patchy Blowing Snow'), ): self.assertEqual(translate.wxcode(code), translation)
def test_wxcode(self): """ Tests expanding weather codes or ignoring them """ for code, translation in ( ("", ""), ("R03/03002V03", "R03/03002V03"), ("+RATS", "Heavy Rain Thunderstorm"), ("VCFC", "Vicinity Funnel Cloud"), ("-GR", "Light Hail"), ("FZFG", "Freezing Fog"), ("BCBLSN", "Patchy Blowing Snow"), ): self.assertEqual(translate.wxcode(code), translation)