def test_convert_icon_unavailable(self): """Test the convertion of an unavailable icon name to a generic code """ # create object text_generator = TextGenerator("package") self.assertEqual(text_generator.convert_icon("unavailable"), " ")
def test_convert_icon_none(self): """Test the convertion of a null icon name is handled """ # create object text_generator = TextGenerator("package") self.assertEqual(text_generator.convert_icon(None), "")
def test_convert_icon(self): """Test the convertion of an available icon name to its code """ # create object text_generator = TextGenerator("package") text_generator.icon_map = {"music": "0xf001"} self.assertEqual(text_generator.convert_icon("music"), "\uf001") self.assertEqual(text_generator.convert_icon("other"), " ")