Ejemplo n.º 1
0
class stopAttack(unittest.TestCase):
    """ Test cases of stopAttack """
    
    def  setUp(self):
        """ Build the Ability and Pkmn for the test """
        self.ability = SkipTurnAbility(None)
        self.pkmn = BuildPokemonBattleWrapper()
        
    def stop(self):
        """ Test that the ability returns correctly when it should stop """
        self.ability.stop = 0
        stop, messages = self.ability.stopAttack(self.pkmn)
        
        assert stop, "Should stop"
        assert messages == [self.pkmn.getHeader() + SkipTurnAbility.message], "Should receive message that the Pkmn is loafing"
        
    def noStop(self):
        """ Test that the ability returns correctly when it should not stop """
        self.ability.stop = 1
        stop, messages = self.ability.stopAttack(self.pkmn)
        
        assert not stop, "Should not stop"
        assert messages == [], "Should not receive any messages"
Ejemplo n.º 2
0
class stopAttack(unittest.TestCase):
    """ Test cases of stopAttack """
    def setUp(self):
        """ Build the Ability and Pkmn for the test """
        self.ability = SkipTurnAbility(None)
        self.pkmn = BuildPokemonBattleWrapper()

    def stop(self):
        """ Test that the ability returns correctly when it should stop """
        self.ability.stop = 0
        stop, messages = self.ability.stopAttack(self.pkmn)

        assert stop, "Should stop"
        assert messages == [
            self.pkmn.getHeader() + SkipTurnAbility.message
        ], "Should receive message that the Pkmn is loafing"

    def noStop(self):
        """ Test that the ability returns correctly when it should not stop """
        self.ability.stop = 1
        stop, messages = self.ability.stopAttack(self.pkmn)

        assert not stop, "Should not stop"
        assert messages == [], "Should not receive any messages"