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


Python BuildPokemonBattleWrapper.reset方法代码示例

本文整理汇总了Python中Test.test_helper.BuildPokemonBattleWrapper.reset方法的典型用法代码示例。如果您正苦于以下问题:Python BuildPokemonBattleWrapper.reset方法的具体用法?Python BuildPokemonBattleWrapper.reset怎么用?Python BuildPokemonBattleWrapper.reset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Test.test_helper.BuildPokemonBattleWrapper的用法示例。


在下文中一共展示了BuildPokemonBattleWrapper.reset方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: reset

# 需要导入模块: from Test.test_helper import BuildPokemonBattleWrapper [as 别名]
# 或者: from Test.test_helper.BuildPokemonBattleWrapper import reset [as 别名]
class reset(unittest.TestCase):
    """ Test cases of reset """
    
    def  setUp(self):
        """ Build the Pkmn """
        self.pkmn = BuildPokemonBattleWrapper()
        
    def statModsAreReset(self):
        """ Test that stats are actually reset """
        for key in self.pkmn.statMods:
            self.pkmn.statMods[key] = 2
        
        for key in self.pkmn.statMods:
            assert self.pkmn.statMods[key] == 2, "Stat should be changed"
            
        self.pkmn.reset()
        
        for key in self.pkmn.statMods:
            assert self.pkmn.statMods[key] == 0, "Stat should be zero"
        
    def flinchingIsReset(self):
        """ Test that flinching is reset """
        self.pkmn.flinching = True
        self.pkmn.reset()
        assert not self.pkmn.flinching, "Pkmn should not be flinching after reset"
        
    def lastActionIsReset(self):
        """ Test that lastAction is reset """
        self.pkmn.lastAction = 2
        self.pkmn.reset()
        assert self.pkmn.lastAction == None, "Pkmn should not have a lastAction after reset"
        
    def actionLockIsReset(self):
        """ Test that actionLock is reset """
        self.pkmn.actionLock = 2
        self.pkmn.reset()
        assert self.pkmn.actionLock == None, "Pkmn should not have a actionLock after reset"
        
    def dodgeIsReset(self):
        """ Test that dodge is reset """
        self.pkmn.dodge = 2
        self.pkmn.reset()
        assert self.pkmn.dodge == None, "Pkmn should not have a dodge after reset"
        
    def secondaryEffectsAreReset(self):
        """ Test that dodge is reset """
        self.pkmn.secondaryEffects = [2]
        self.pkmn.reset()
        assert self.pkmn.secondaryEffects == [], "Pkmn should not have any secondary effects after reset"
开发者ID:cloew,项目名称:Pokemon-Project,代码行数:51,代码来源:pkmn_battle_wrapper_test.py


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