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


Python BuildPokemonBattleWrapper.getStatus方法代码示例

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


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

示例1: checkCurable

# 需要导入模块: from Test.test_helper import BuildPokemonBattleWrapper [as 别名]
# 或者: from Test.test_helper.BuildPokemonBattleWrapper import getStatus [as 别名]
class checkCurable(unittest.TestCase):
    """ Test that checkCurable actually cures a status when possible """
    
    def setUp(self):
        """ Builds the delegate and pkmn for use in the tests """
        self.pkmn = BuildPokemonBattleWrapper()
        
        self.statusAbbr = "PAR"
        self.status = Paralysis()
        self.statusAbbr2 = "FRZ"
        
        self.delegate = CureStatusDelegate(self.statusAbbr, 1)
        self.delegate2 = CureStatusDelegate(self.statusAbbr2, 1)
        
    def isCurable(self):
        """ Tests if checkCurable cures the status when it can """
        self.pkmn.setStatus(self.status)
        self.delegate.checkCurable(self.pkmn)
        
        assert self.pkmn.getStatus() != self.status, "Status should be cured"
        
    def notCurable(self):
        """ Tests if checkCurable cures the status when it can """
        self.pkmn.setStatus(self.status)
        self.delegate2.checkCurable(self.pkmn)
        
        assert self.pkmn.getStatus() == self.status, "Status should not be cured"
开发者ID:cloew,项目名称:Pokemon-Project,代码行数:29,代码来源:curestatus_test.py

示例2: immobilized

# 需要导入模块: from Test.test_helper import BuildPokemonBattleWrapper [as 别名]
# 或者: from Test.test_helper.BuildPokemonBattleWrapper import getStatus [as 别名]
class immobilized(unittest.TestCase):
    """ Test that immobilized performs correctly """
    
    def setUp(self):
        """ Builds the Sleep status"""
        self.status = Sleep()
        self.pkmn = BuildPokemonBattleWrapper()
        self.pkmn.setStatus(self.status)
        self.turns = 1
    
    def notDone(self):
        """ Test if immobilized returns correctly when it is not done """
        self.status.turns = self.turns
        
        immobilized, messages = self.status.immobilized(self.pkmn)
        
        assert immobilized, "Should be immobilized"
        assert messages == [self.pkmn.getHeader() + Sleep.intermittent],\
                "Should return Sleep's intermittent message"
        assert self.status.turns == self.turns - 1, "Turns should be decremented"
        
    def done(self):
        """ Test if immobilized returns correctly when it is done """
        self.status.turns = 0
        
        assert self.pkmn.getStatus() == self.status, "Should have status to start"
        
        immobilized, messages = self.status.immobilized(self.pkmn)
        
        assert not immobilized, "Should not be immobilized"
        assert len(messages) == 2, "Should have two messages"
        
        assert messages[0] == self.pkmn.getHeader() + Sleep.intermittent,\
                "Should return Sleep's intermittent message"
        assert messages[1] == self.pkmn.getHeader() + Sleep.done,\
                "Should return Sleep's done message"
                
        assert self.pkmn.getStatus() != self.status, "Status should be removed"
开发者ID:cloew,项目名称:Pokemon-Project,代码行数:40,代码来源:sleep_test.py

示例3: applyStatus

# 需要导入模块: from Test.test_helper import BuildPokemonBattleWrapper [as 别名]
# 或者: from Test.test_helper.BuildPokemonBattleWrapper import getStatus [as 别名]
class applyStatus(unittest.TestCase):
    """ Test that applyStatus actually applies a status """
    
    def setUp(self):
        """ Builds the delegate and pkmn for use in the tests """
        self.pkmn = BuildPokemonBattleWrapper()
        self.status = "PAR"
        attack = Attack()
        attack.type = ""
        self.delegate = ApplyStatusDelegate(attack, self.status, 1)
        
    def appliesStatusUser(self):
        """ Tests if applyStatus applies the staus and returns the method """
        self.delegate.affectUser = 1
        self.delegate.applyStatus(self.pkmn)
        assert self.pkmn.getStatus().abbr == self.status, "Status should be PAR on the user pkmn"
开发者ID:cloew,项目名称:Pokemon-Project,代码行数:18,代码来源:applystatus_test.py


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