本文整理汇总了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')
示例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')
示例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')
示例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')
示例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')
示例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')
示例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')
示例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')