Example #1
0
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"
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"
Example #3
0
 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 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)