本文整理汇总了Python中TestUtilities.get_record_count_from_table方法的典型用法代码示例。如果您正苦于以下问题:Python TestUtilities.get_record_count_from_table方法的具体用法?Python TestUtilities.get_record_count_from_table怎么用?Python TestUtilities.get_record_count_from_table使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TestUtilities
的用法示例。
在下文中一共展示了TestUtilities.get_record_count_from_table方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_zone_properties_from_id
# 需要导入模块: import TestUtilities [as 别名]
# 或者: from TestUtilities import get_record_count_from_table [as 别名]
def test_zone_properties_from_id(self):
hPk = dbHelp.setup_test_hero_using_default_values()
z = dbHelp.create_test_zone_obj()
testZoneKey = ZoneDefinitionFields.EMPTY_SPACE
z.save_changes(hPk)
zPk = z.get_pk()
z2 = z.construct_model_from_pk(zPk)
self.assertEqual(z.definitionKey, testZoneKey)
self.assertEqual(z.get_fullName(), ZoneDefinition.get_name_for_key(testZoneKey) + " Alpha")
self.assertEqual(z.suffix,"Alpha")
self.assertEqual(z.monstersKilled, 2)
self.assertEqual(z.maxMonsters,15)
self.assertEqual(z.lvl, 3)
self.assertEqual(z.get_description(),ZoneDefinition.get_description_for_key(testZoneKey))
oldCount = tu.get_record_count_from_table(ZoneDBFields.COLLECTION_NAME)
z.save_changes(hPk)
newCount = tu.get_record_count_from_table(ZoneDBFields.COLLECTION_NAME)
self.assertEqual(oldCount , newCount)
示例2: test_monster_properties_from_dict
# 需要导入模块: import TestUtilities [as 别名]
# 或者: from TestUtilities import get_record_count_from_table [as 别名]
def test_monster_properties_from_dict(self):
hpk = dbHelp.setup_test_hero_using_default_values()
md = dbHelp.create_test_monster_dict()
m = Monster.construct_model_from_dict(md)
self.assertEqual(m.nowHp,100)
self.assertEqual(m.maxHp,150)
self.assertEqual(m.get_baseXpReward(),1)
self.assertEqual(m.get_treasureDropRate(),.1)
self.assertEqual(m.definitionKey,MonsterDefinitionFields.AMBUSH_PIRATES)
self.assertEqual(len(m.get_treasureDrops()), 0)
self.assertEqual(m.get_name(),"Sneaky Ambush Pirates")
self.assertEqual(m.get_description(),"These Sneaky Pirates hide behind asteroids "
"and surprise you. They're sorta like deadlines.")
oldCount = tu.get_record_count_from_table(MonsterDbFields.COLLECTION_NAME)
m.save_changes(hpk)
newcount = tu.get_record_count_from_table(MonsterDbFields.COLLECTION_NAME)
self.assertEqual(oldCount,newcount)
示例3: test_save_counts
# 需要导入模块: import TestUtilities [as 别名]
# 或者: from TestUtilities import get_record_count_from_table [as 别名]
def test_save_counts(self):
hDict = dbHelp.create_test_hero_dict()
h = Hero.construct_model_from_dict(hDict)
oldHeroCount = tu.get_record_count_from_table(HeroDbFields.COLLECTION_NAME)
oldZoneCOunt = tu.get_record_count_from_table(ZoneDBFields.COLLECTION_NAME)
h.save_changes()
newHeroCount = tu.get_record_count_from_table(HeroDbFields.COLLECTION_NAME)
newZoneCount = tu.get_record_count_from_table(ZoneDBFields.COLLECTION_NAME)
self.assertEqual(oldHeroCount+1,newHeroCount)
self.assertEqual(oldZoneCOunt+1,newZoneCount)
oldHeroCount = tu.get_record_count_from_table(HeroDbFields.COLLECTION_NAME)
oldZoneCOunt = tu.get_record_count_from_table(ZoneDBFields.COLLECTION_NAME)
h.save_changes()
newHeroCount = tu.get_record_count_from_table(HeroDbFields.COLLECTION_NAME)
newZoneCount = tu.get_record_count_from_table(ZoneDBFields.COLLECTION_NAME)
self.assertEqual(oldHeroCount,newHeroCount)
self.assertEqual(oldZoneCOunt,newZoneCount)