示例#1
0
    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"), " ")
示例#2
0
    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), "")
示例#3
0
    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"), " ")