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)
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"
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"
def immune(self): """ Test an effect that is immune will result in a miss """ status, message = StatusFactory.buildStatusFromAbbr("PAR") self.pkmn.setStatus(status) effect = ApplyStatusDelegate(self.parent, "PAR", 1) self.buildDelegate(effect) assert self.delegate.immune(self.pkmn, None), "Should be immune"
def notImmune(self): """ Test an effect that is not immune returns correctly """ status = Status() self.pkmn.setStatus(status) effect = ApplyStatusDelegate(self.parent, "PAR", 1) self.buildDelegate(effect) assert not self.delegate.immune(self.pkmn, None), "Should not be immune"
class checkStatusAlready(unittest.TestCase): """ Test that checkStatusAlready returns correctly """ 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 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 hasNoStatusAlready(self): """ Tests checkStatusAlready returns correctly if the pkmn has a status already """ self.pkmn.setStatus(Status()) assert not self.delegate.checkStatusAlready(self.pkmn), "Should not have a status already"
class checkStatusAlready(unittest.TestCase): """ Test that checkStatusAlready returns correctly """ 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 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 hasNoStatusAlready(self): """ Tests checkStatusAlready returns correctly if the pkmn has a status already """ self.pkmn.setStatus(Status()) assert not self.delegate.checkStatusAlready( self.pkmn), "Should not have a status already"