def  setUp(self):
     """ Build the Pkmn and Delegate for the test """
     self.user = BuildPokemonBattleWrapper()
     self.target = BuildPokemonBattleWrapper()
     self.environment = BattleEnvironment()
     
     self.delegate = NullDamageDelegate()
class doDamage(unittest.TestCase):
    """ Test cases of doDamage """
    
    def  setUp(self):
        """ Build the Pkmn and Delegate for the test """
        self.user = BuildPokemonBattleWrapper()
        self.target = BuildPokemonBattleWrapper()
        self.environment = BattleEnvironment()
        
        self.delegate = NullDamageDelegate()
        
    def noMessages(self):
        """ Test that doDamage returns no messages """
        messages = self.delegate.doDamage(self.user, self.target, self.environment)
        assert messages == [], "Should return no messages"
Example #3
0
 def buildNull():
     """ Returns a Null damage delegate """
     return NullDamageDelegate()
Example #4
0
 def status(self):
     """ Test hitGhost function returns true correctly when the attack is a status attack """
     self.attack.damageDelegate = NullDamageDelegate()
     self.pkmn.setTypes(["GHOST"])
     self.attack.type = "NORMAL"
     assert self.delegate.hitGhost(self.pkmn), "Should hit a Ghost if it is a status move"
Example #5
0
 def setUp(self):
     """ Build the Attack and Damage Delegate for the test """
     self.attack = Attack()
     self.nullDamageDelegate = NullDamageDelegate()
     self.normalDamageDelegate = DamageDelegate(None, None, None)