当前位置: 首页>>代码示例>>Python>>正文


Python BuildPokemonBattleWrapper.setAbility方法代码示例

本文整理汇总了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"
开发者ID:cloew,项目名称:Pokemon-Project,代码行数:30,代码来源:swap_ability_test.py


注:本文中的Test.test_helper.BuildPokemonBattleWrapper.setAbility方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。