本文整理匯總了Python中effect.Effect.total_strength方法的典型用法代碼示例。如果您正苦於以下問題:Python Effect.total_strength方法的具體用法?Python Effect.total_strength怎麽用?Python Effect.total_strength使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類effect.Effect
的用法示例。
在下文中一共展示了Effect.total_strength方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: TestEffect
# 需要導入模塊: from effect import Effect [as 別名]
# 或者: from effect.Effect import total_strength [as 別名]
class TestEffect(unittest.TestCase):
def setUp(self):
self.expected_str = 'Effect:\n\tATT - MAGIC: 5 PHYSICAL: 5\n\tDEF - MAGIC: 5 PHYSICAL: 5\n\tSTATS - HP: 5 STR: 5 INT: 5 AGI: 5'
self.expected_attack = Damage(6,6)
self.expected_defense = Damage(6,6)
self.expected_stats = Stats(6,6,6,6)
self.test_effect = Effect(Damage(5,5), Damage(5,5), Stats(5,5,5,5))
def tearDown(self):
self.expected_attack = None
self.expected_defense = None
self.expected_stats = None
self.test_effect = None
def test_total_strength(self):
self.assertEqual(5, self.test_effect.total_strength())
def test_total_intelligence(self):
self.assertEqual(5, self.test_effect.total_intelligence())
def test_total_agility(self):
self.assertEqual(5, self.test_effect.total_agility())
def test_total_hp(self):
self.assertEqual(5, self.test_effect.total_hp())
def test_total_attack(self):
self.assertEqual(Damage(5,5), self.test_effect.total_attack())
def test_total_defense(self):
self.assertEqual(Damage(5,5), self.test_effect.total_defense())
# def test_increase_attack(self):
# self.test_effect.increase_attack((1,1))
# self.assertEqual(self.expected_attack, self.test_effect.attack)
# def test_increase_defense(self):
# self.test_effect.increase_defense((1,1))
# self.assertEqual(self.expected_defense, self.test_effect.defense)
# def test_increase_stats(self):
# self.test_effect.increase_stats((1,1,1,1))
# self.assertEqual(self.expected_stats, self.test_effect.stats)
def test_str(self):
self.assertEqual(self.expected_str, str(self.test_effect))