def test_visibility(self): """ Tests converting visibility distance into a spoken string """ for vis, unit, spoken in ( ('', 'm', 'unknown'), ('0000', 'm', 'zero kilometers'), ('2000', 'm', 'two kilometers'), ('0900', 'm', 'point nine kilometers'), ('P6', 'sm', 'greater than six miles'), ('M1/4', 'sm', 'less than one quarter of a mile'), ('3/4', 'sm', 'three quarters of a mile'), ('3/2', 'sm', 'one and one half miles'), ('3', 'sm', 'three miles'), ): self.assertEqual(speech.visibility(core.make_number(vis), unit), 'Visibility ' + spoken)
def test_visibility(self): """ Tests converting visibility distance into a spoken string """ for vis, unit, spoken in ( ("", "m", "unknown"), ("0000", "m", "zero kilometers"), ("2000", "m", "two kilometers"), ("0900", "m", "point nine kilometers"), ("P6", "sm", "greater than six miles"), ("M1/4", "sm", "less than one quarter of a mile"), ("3/4", "sm", "three quarters of a mile"), ("3/2", "sm", "one and one half miles"), ("3", "sm", "three miles"), ): self.assertEqual(speech.visibility(_core.make_number(vis), unit), "Visibility " + spoken)