本文整理汇总了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"
示例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"
示例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"