本文整理匯總了Python中Zone.Zone.get_description方法的典型用法代碼示例。如果您正苦於以下問題:Python Zone.get_description方法的具體用法?Python Zone.get_description怎麽用?Python Zone.get_description使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Zone.Zone
的用法示例。
在下文中一共展示了Zone.get_description方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_load_zone_from_pk
# 需要導入模塊: from Zone import Zone [as 別名]
# 或者: from Zone.Zone import get_description [as 別名]
def test_load_zone_from_pk(self):
pk = dbHelp.create_test_hero_using_test_values()
z1 = Zone("gas")
z1.maxMonsters = 10
z1.lvl = 10
z1.save_changes(pk)
z2 = Zone.construct_model_from_pk(z1.get_pk())
self.assertEqual(z1.get_description(),z2.get_description())
self.assertEqual(z1.get_fullName(),z2.get_fullName())
self.assertEqual(z1.maxMonsters,z2.maxMonsters)
self.assertEqual(z1.lvl,z2.lvl)
示例2: test_zone_properties_default
# 需要導入模塊: from Zone import Zone [as 別名]
# 或者: from Zone.Zone import get_description [as 別名]
def test_zone_properties_default(self):
testZoneKey = ZoneDefinitionFields.EMPTY_SPACE
z = Zone(testZoneKey)
z.suffix = "Alpha"
z.monstersKilled = 5
z.maxMonsters = 10
z.lvl = 4
pZPk = dbHelp.create_test_zone_obj(ZoneDefinitionFields.HOME).get_pk()
z.previousZoneReferencePK = pZPk
z.nextZoneReferenceList = [dbHelp.create_test_zone_dict(ZoneDefinitionFields.ASTEROID_FIELD),
dbHelp.create_test_zone_dict(ZoneDefinitionFields.GAS),
dbHelp.create_test_zone_dict(ZoneDefinitionFields.NEBULA)]
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, 5)
self.assertEqual(z.maxMonsters,10)
self.assertEqual(z.lvl, 4)
self.assertEqual(z.get_description(),ZoneDefinition.get_description_for_key(testZoneKey))
self.assertEqual(z.previousZoneReferencePK,pZPk)
self.assertListEqual(z.nextZoneReferenceList,[dbHelp.create_test_zone_dict(ZoneDefinitionFields.ASTEROID_FIELD),
dbHelp.create_test_zone_dict(ZoneDefinitionFields.GAS),
dbHelp.create_test_zone_dict(ZoneDefinitionFields.NEBULA)])