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


Python Resources.class_方法代码示例

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


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

示例1: testClassLoader

# 需要导入模块: import Resources [as 别名]
# 或者: from Resources import class_ [as 别名]
 def testClassLoader(self):
     '''Should load class data from file'''
     data = Resources.class_('fighter')
     self.assertEqual(data.name, 'Fighter-c')
开发者ID:jemofthewest,项目名称:GalaxyMage,代码行数:6,代码来源:ResourcesTest.py

示例2: testPrefersDataFromDemoOverExtra

# 需要导入模块: import Resources [as 别名]
# 或者: from Resources import class_ [as 别名]
 def testPrefersDataFromDemoOverExtra(self):
     '''Should load data from 'data/demo' if that data also is in 'data/extra'. '''
     data = Resources.class_('snitch')
     self.assertEqual(data.name, 'Snitch-d')
开发者ID:jemofthewest,项目名称:GalaxyMage,代码行数:6,代码来源:ResourcesTest.py

示例3: testShouldErrorIfDataDoesNotExist

# 需要导入模块: import Resources [as 别名]
# 或者: from Resources import class_ [as 别名]
 def testShouldErrorIfDataDoesNotExist(self):
     '''Should return an error if trying to load missing data'''
     try:
         data = Resources.class_('missing')
     except Exception, e:
         self.assertEqual(str(e), 'Class file "None" not found')
开发者ID:jemofthewest,项目名称:GalaxyMage,代码行数:8,代码来源:ResourcesTest.py

示例4: testPrefersDataFromDemoOverCore

# 需要导入模块: import Resources [as 别名]
# 或者: from Resources import class_ [as 别名]
 def testPrefersDataFromDemoOverCore(self):
     '''Should load data from 'data/demo' if that data also is in 'data/core'. '''
     data = Resources.class_('thief')
     self.assertEqual(data.name, 'Thief-d')
开发者ID:jemofthewest,项目名称:GalaxyMage,代码行数:6,代码来源:ResourcesTest.py

示例5: testPrefersDataFromExtraOverCore

# 需要导入模块: import Resources [as 别名]
# 或者: from Resources import class_ [as 别名]
 def testPrefersDataFromExtraOverCore(self):
     '''Should load data from 'data/extra' if that data also is in 'data/core'. '''
     data = Resources.class_('beggar')
     self.assertEqual(data.name, 'Beggar-e')
开发者ID:jemofthewest,项目名称:GalaxyMage,代码行数:6,代码来源:ResourcesTest.py

示例6: testLoadsDataFromDemo

# 需要导入模块: import Resources [as 别名]
# 或者: from Resources import class_ [as 别名]
 def testLoadsDataFromDemo(self):
     '''Should load data from the 'data/demo' folder'''
     # first, verify that the current campaign is demo
     self.assertEqual(Resources.campaign, 'demo')
     data = Resources.class_('ruffian')
     self.assertEqual(data.name, 'Ruffian-d')
开发者ID:jemofthewest,项目名称:GalaxyMage,代码行数:8,代码来源:ResourcesTest.py

示例7: testLoadsDataFromExtra

# 需要导入模块: import Resources [as 别名]
# 或者: from Resources import class_ [as 别名]
 def testLoadsDataFromExtra(self):
     '''Should load data from the 'data/extra' folder'''
     data = Resources.class_('bandit')
     self.assertEqual(data.name, 'Bandit-e')
开发者ID:jemofthewest,项目名称:GalaxyMage,代码行数:6,代码来源:ResourcesTest.py

示例8: testLoadsDataFromCore

# 需要导入模块: import Resources [as 别名]
# 或者: from Resources import class_ [as 别名]
 def testLoadsDataFromCore(self):
     '''Should load data from the 'data/core' folder'''
     data = Resources.class_('fighter')
     self.assertEqual(data.name, 'Fighter-c')
开发者ID:jemofthewest,项目名称:GalaxyMage,代码行数:6,代码来源:ResourcesTest.py


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