本文整理汇总了Python中console.Console.roms_directory方法的典型用法代码示例。如果您正苦于以下问题:Python Console.roms_directory方法的具体用法?Python Console.roms_directory怎么用?Python Console.roms_directory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类console.Console
的用法示例。
在下文中一共展示了Console.roms_directory方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: ConsoleTests
# 需要导入模块: from console import Console [as 别名]
# 或者: from console.Console import roms_directory [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")
示例2: ConsoleTests
# 需要导入模块: from console import Console [as 别名]
# 或者: from console.Console import roms_directory [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)
示例3: ConsoleTests
# 需要导入模块: from console import Console [as 别名]
# 或者: from console.Console import roms_directory [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")