class getStatMod(unittest.TestCase): """ Test that statMod returns the correct values for all stats """ def setUp(self): """ Builds the Paralysis status""" self.status = Paralysis() def checkStatMods(self): """ Test that stat modifiers are correct for Paralysis .75 for SPD, 1 for the rest""" for key in self.status.statMods: if key == "SPD": assert self.status.getStatMod(key) == .25, "SPD should be .25" else: assert self.status.getStatMod(key) == 1, "All stats, except SPD, should be 1"
class getStatMod(unittest.TestCase): """ Test that statMod returns the correct values for all stats """ def setUp(self): """ Builds the Paralysis status""" self.status = Paralysis() def checkStatMods(self): """ Test that stat modifiers are correct for Paralysis .75 for SPD, 1 for the rest""" for key in self.status.statMods: if key == "SPD": assert self.status.getStatMod(key) == .25, "SPD should be .25" else: assert self.status.getStatMod( key) == 1, "All stats, except SPD, should be 1"
def setUp(self): """ Builds the ability and Pkmn for use in the tests """ self.battlePkmn = BuildPokemonBattleWrapper() self.status = Paralysis() self.status2 = Status() self.stat = "ATK" self.mod = 1.5 self.ability = StatModOnStatusAbility("", self.stat, self.mod)
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)
class immune(unittest.TestCase): """ Test that immune returns correctly """ def setUp(self): """ Builds the Paralysis status""" self.status = Paralysis() def immune(self): """ Test if it can correctly identify when the target is immune """ types = ["GROUND"] other = "ELECTRIC" assert self.status.immune( types, other), "Should be immune if GROUND and ELECTRIC combo" types = ["GROUND", "ELECTRIC"] other = "ELECTRIC" assert self.status.immune( types, other ), "Should be immune if GROUND and ELECTRIC combo regardless of other type" types = ["ELECTRIC", "GROUND"] other = "ELECTRIC" assert self.status.immune( types, other ), "Should be immune if GROUND and ELECTRIC combo regardless of other type" def notImmune(self): """ Test if it can correctly identify when the target is immune """ types = ["FIRE"] other = "FIRE" assert not self.status.immune( types, other), "Should not be immune if not GROUND and ELECTRIC combo" types = ["FIRE", "ELECTRIC"] other = "GROUND" assert not self.status.immune( types, other ), "Should not be immune if not GROUND and ELECTRIC combo in the right order" types = ["GROUND", "ELECTRIC"] other = "FIRE" assert not self.status.immune( types, other), "Should not be immune if only GROUND" types = ["ELECTRIC"] other = "ELECTRIC" assert not self.status.immune( types, other), "Should not be immune if only ELECTRIC"
class immune(unittest.TestCase): """ Test that immune returns correctly """ def setUp(self): """ Builds the Paralysis status""" self.status = Paralysis() def immune(self): """ Test if it can correctly identify when the target is immune """ types = ["GROUND"] other = "ELECTRIC" assert self.status.immune(types, other), "Should be immune if GROUND and ELECTRIC combo" types = ["GROUND", "ELECTRIC"] other = "ELECTRIC" assert self.status.immune(types, other), "Should be immune if GROUND and ELECTRIC combo regardless of other type" types = ["ELECTRIC", "GROUND"] other = "ELECTRIC" assert self.status.immune(types, other), "Should be immune if GROUND and ELECTRIC combo regardless of other type" def notImmune(self): """ Test if it can correctly identify when the target is immune """ types = ["FIRE"] other = "FIRE" assert not self.status.immune(types, other), "Should not be immune if not GROUND and ELECTRIC combo" types = ["FIRE", "ELECTRIC"] other = "GROUND" assert not self.status.immune(types, other), "Should not be immune if not GROUND and ELECTRIC combo in the right order" types = ["GROUND", "ELECTRIC"] other = "FIRE" assert not self.status.immune(types, other), "Should not be immune if only GROUND" types = ["ELECTRIC"] other = "ELECTRIC" assert not self.status.immune(types, other), "Should not be immune if only ELECTRIC"
def hasStatusAlready(self): """ Tests checkStatusAlready returns correctly if the pkmn has a status already """ self.pkmn.setStatus(Paralysis()) assert self.delegate.checkStatusAlready( self.pkmn), "Should have a status already"
def setUp(self): """ Builds the Paralysis status""" self.status = Paralysis()
def notParalyzed(self): """ Test if values for paralyzed return correctly """ for i in range(25, 100): assert not Paralysis.paralyzed(i), "Should be paralyzed on 0-24"