当前位置: 首页>>代码示例>>Python>>正文


Python Console.icon_path方法代码示例

本文整理汇总了Python中console.Console.icon_path方法的典型用法代码示例。如果您正苦于以下问题:Python Console.icon_path方法的具体用法?Python Console.icon_path怎么用?Python Console.icon_path使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在console.Console的用法示例。


在下文中一共展示了Console.icon_path方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: ConsoleTests

# 需要导入模块: from console import Console [as 别名]
# 或者: from console.Console import icon_path [as 别名]
class ConsoleTests(unittest.TestCase):
    def setUp(self):
        self.console = Console("Test","Test Console")
        
    def test_console_lookup(self):
        """
        Console lookup should do a few things:
        
        1) It should return the object from supported_consoles
        2) It should return the same instance every time
        3) It should return None when the console of that name is not found
        """
        # 1
        self.assertTrue(console_lookup("GBA") in supported_consoles)
        # 2
        self.assertEqual(console_lookup("GBA"),gba)
        self.assertEqual(console_lookup("GBA"),gba)
        # 3
        self.assertTrue(console_lookup("Random String") == None)
        
    # @unittest.skip("Not yet implemented")
    # def test_find_all_roms(self):
    #     pass
    # 
    # @unittest.skip("Not yet implemented")    
    # def test_find_all_roms_for_console(self):
    #     pass
        
    def test_roms_directory(self):
        """
        The ROMs directory for a console should be the ROMs directory from
        filesystem_helper, except the directory name should be equal to the
        shortname for the console
        """
        gba_dir = self.console.roms_directory()
        self.assertEqual(os.path.dirname(gba_dir),filesystem_helper.roms_directory())
        self.assertEqual(os.path.basename(gba_dir),self.console.shortname)
        
    def test_executables_directory(self):
        """
        The executables directory for a console should be a directory located
        in the main executables directory, and the consoles directory should be
        named the same as the shortname of the console
        """
        gba_dir = self.console.executables_directory()
        self.assertEqual(os.path.dirname(gba_dir),filesystem_helper.executables_directory())
        self.assertEqual(os.path.basename(gba_dir),self.console.shortname)
        
    def test_icon_path(self):
        """
        The icon path for a console should be in the icons directory, and the
        file should be named the shortname of the console with a .png extension
        """
        gba_path = self.console.icon_path()
        self.assertEqual(os.path.dirname(gba_path),filesystem_helper.icons_directory())
        self.assertEqual(os.path.basename(gba_path),self.console.shortname + ".png")
开发者ID:rrfenton,项目名称:Ice,代码行数:58,代码来源:console_tests.py

示例2: ConsoleTests

# 需要导入模块: from console import Console [as 别名]
# 或者: from console.Console import icon_path [as 别名]
class ConsoleTests(unittest.TestCase):
    def setUp(self):
        self.console = Console("Test","Test Console")
        
    # @unittest.skip("Not yet implemented")
    # def test_find_all_roms(self):
    #     pass
    # 
    # @unittest.skip("Not yet implemented")    
    # def test_find_all_roms_for_console(self):
    #     pass
        
    def test_roms_directory(self):
        """
        The ROMs directory for a console should be the ROMs directory from
        filesystem_helper, except the directory name should be equal to the
        shortname for the console
        """
        gba_dir = self.console.roms_directory()
        self.assertEqual(os.path.dirname(gba_dir),filesystem_helper.roms_directory())
        self.assertEqual(os.path.basename(gba_dir),self.console.shortname)
        
    def test_executables_directory(self):
        """
        The executables directory for a console should be a directory located
        in the main executables directory, and the consoles directory should be
        named the same as the shortname of the console
        """
        gba_dir = self.console.executables_directory()
        self.assertEqual(os.path.dirname(gba_dir),filesystem_helper.executables_directory())
        self.assertEqual(os.path.basename(gba_dir),self.console.shortname)
        
    def test_icon_path(self):
        """
        The icon path for a console should be in the icons directory, and the
        file should be named the shortname of the console with a .png extension
        """
        gba_path = self.console.icon_path()
        self.assertEqual(os.path.dirname(gba_path),filesystem_helper.icons_directory())
        self.assertEqual(os.path.basename(gba_path),self.console.shortname + ".png")
开发者ID:waytai,项目名称:Ice,代码行数:42,代码来源:console_tests.py


注:本文中的console.Console.icon_path方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。