本文整理汇总了Python中Test.test_helper.BuildPokemonBattleWrapper.setAbility方法的典型用法代码示例。如果您正苦于以下问题:Python BuildPokemonBattleWrapper.setAbility方法的具体用法?Python BuildPokemonBattleWrapper.setAbility怎么用?Python BuildPokemonBattleWrapper.setAbility使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Test.test_helper.BuildPokemonBattleWrapper
的用法示例。
在下文中一共展示了BuildPokemonBattleWrapper.setAbility方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: applyEffect
# 需要导入模块: from Test.test_helper import BuildPokemonBattleWrapper [as 别名]
# 或者: from Test.test_helper.BuildPokemonBattleWrapper import setAbility [as 别名]
class applyEffect(unittest.TestCase):
""" Test cases of applyEffect """
def setUp(self):
""" Build the Pkmn, Abilities and Effect for the test """
self.user = BuildPokemonBattleWrapper()
self.target = BuildPokemonBattleWrapper()
self.userAbility = Ability(None)
self.targetAbility = Ability(None)
self.user.setAbility(self.userAbility)
self.target.setAbility(self.targetAbility)
self.delegate = SwapAbilityDelegate()
def swapped(self):
""" Test that the abilities are swapped """
self.delegate.applyEffect(self.user, self.target, None)
assert self.user.getAbility() is self.targetAbility, "User should have target's ability"
assert self.target.getAbility() is self.userAbility, "Target should have user's ability"
def message(self):
""" Test message is returned correctly """
messages = self.delegate.applyEffect(self.user, self.target, None)
assert messages == [SwapAbilityDelegate.message % (self.user.getHeader(), self.target.getHeader())], "Should have the Effect's message"