本文整理汇总了Python中effect.Effect.total_attack方法的典型用法代码示例。如果您正苦于以下问题:Python Effect.total_attack方法的具体用法?Python Effect.total_attack怎么用?Python Effect.total_attack使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类effect.Effect
的用法示例。
在下文中一共展示了Effect.total_attack方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: TestEffect
# 需要导入模块: from effect import Effect [as 别名]
# 或者: from effect.Effect import total_attack [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))