def  setUp(self):
     """ Build the Pkmn, Abilities and Effect for the test """
     self.user = BuildPokemonBattleWrapper()
     self.target = BuildPokemonBattleWrapper()
     
     self.userAbility = Ability(None)
     self.targetAbility = Ability(None)
     
     self.user.setAbility(self.userAbility)
     self.target.setAbility(self.targetAbility)
     
     self.delegate = SwapAbilityDelegate()
Esempio n. 2
0
class canBeConfused(unittest.TestCase):
    """ Test that canBeConfused returns the correct default values """

    def setUp(self):
        """ Builds the ability """
        self.pkmn = BuildPokemonBattleWrapper()
        self.ability = Ability(None)

    def properReturnValues(self):
        """ Check that canBeConfused returns the proper default values """
        assert self.ability.canBeConfused(None, []), "Should be able to be Confused"

    def properReturnValues_NoMessagesObject(self):
        """ Check that canBeConfused returns the proper default values """
        assert self.ability.canBeConfused(None, None), "Should be able to be Confused"
Esempio n. 3
0
class canBeConfused(unittest.TestCase):
    """ Test that canBeConfused returns the correct default values """
    def setUp(self):
        """ Builds the ability """
        self.pkmn = BuildPokemonBattleWrapper()
        self.ability = Ability(None)

    def properReturnValues(self):
        """ Check that canBeConfused returns the proper default values """
        assert self.ability.canBeConfused(None,
                                          []), "Should be able to be Confused"

    def properReturnValues_NoMessagesObject(self):
        """ Check that canBeConfused returns the proper default values """
        assert self.ability.canBeConfused(
            None, None), "Should be able to be Confused"
Esempio n. 4
0
class powerPointsPressure(unittest.TestCase):
    """ Test that powerPointsPressure returns the correct default values """
    def setUp(self):
        """ Builds the ability """
        self.ability = Ability(None)

    def properReturnValues(self):
        """ Check that powerPointsPressure returns the proper default values """
        pressure = self.ability.powerPointsPressure()
        assert pressure == 1, "Pressure should be 1 by default"
Esempio n. 5
0
class afterTurn(unittest.TestCase):
    """ Test that afterTurn returns the correct default values """
    def setUp(self):
        """ Builds the ability """
        self.ability = Ability(None)

    def properReturnValues(self):
        """ Check that afterTurn returns the proper default values """
        messages = self.ability.afterTurn(None)
        assert len(messages) == 0, "Messages should have no elements"
Esempio n. 6
0
 def buildStarter(self, species):
     """ Creates a Pokemon with Starter stats """
     self.name = species
     self.species = species
     self.level = 5
     self.ability = Ability()
     self.battleDelegate = PokemonBattleDelegate().buildStarter(self)
     self.displayDelegate = PokemonDisplayDelegate(self.species)
 
     return self
Esempio n. 7
0
class canUseEffects(unittest.TestCase):
    """ Test that canUseEffects returns the correct default values """
    def setUp(self):
        """ Builds the ability """
        self.ability = Ability(None)

    def properReturnValues(self):
        """ Check that afterTurn returns the proper default values """
        can = self.ability.canUseEffects()
        assert can, "Should be able to use Effects"
Esempio n. 8
0
class onAccuracy(unittest.TestCase):
    """ Test that onAccuracy returns the correct default values """
    def setUp(self):
        """ Builds the ability """
        self.ability = Ability(None)
        self.accuracy = 90

    def properReturnValues(self):
        """ Check that onAccuracy returns the proper default values """
        accuracy = self.ability.onAccuracy(self.accuracy)
        assert accuracy == self.accuracy, "Accuracy should be unaltered."
Esempio n. 9
0
class stopAttack(unittest.TestCase):
    """ Test that stopAttack returns the correct default values """
    def setUp(self):
        """ Builds the ability """
        self.ability = Ability(None)

    def properReturnValues(self):
        """ Check that stopAttack returns the proper default values """
        stop, messages = self.ability.stopAttack(None)
        assert not stop, "Should not stop"
        assert len(messages) == 0, "Messages should have no elements"
Esempio n. 10
0
class powerPointsPressure(unittest.TestCase):
    """ Test that powerPointsPressure returns the correct default values """

    def setUp(self):
        """ Builds the ability """
        self.ability = Ability(None)

    def properReturnValues(self):
        """ Check that powerPointsPressure returns the proper default values """
        pressure = self.ability.powerPointsPressure()
        assert pressure == 1, "Pressure should be 1 by default"
Esempio n. 11
0
class canUseEffects(unittest.TestCase):
    """ Test that canUseEffects returns the correct default values """

    def setUp(self):
        """ Builds the ability """
        self.ability = Ability(None)

    def properReturnValues(self):
        """ Check that afterTurn returns the proper default values """
        can = self.ability.canUseEffects()
        assert can, "Should be able to use Effects"
Esempio n. 12
0
class onStab(unittest.TestCase):
    """ Test that onStab returns the correct mods """
    def setUp(self):
        """ Builds the delegate and side for use in the tests """
        self.ability = Ability(None)

    def properReturnValues(self):
        """ Check that onStatMod returns the proper default values """
        mod = self.ability.onStab()

        assert mod == self.ability.stabMod, "Stab Mod should be default."
Esempio n. 13
0
class afterTurn(unittest.TestCase):
    """ Test that afterTurn returns the correct default values """

    def setUp(self):
        """ Builds the ability """
        self.ability = Ability(None)

    def properReturnValues(self):
        """ Check that afterTurn returns the proper default values """
        messages = self.ability.afterTurn(None)
        assert len(messages) == 0, "Messages should have no elements"
Esempio n. 14
0
class onStatus(unittest.TestCase):
    """ Test that onStatus returns the correct default values """
    def setUp(self):
        """ Builds the delegate and side for use in the tests """
        self.ability = Ability(None)

    def properReturnValues(self):
        """ Check that onStatus returns the proper default values """
        messages = self.ability.onStatus(None, None)

        assert len(messages) == 0, "Messages should have no elements"
Esempio n. 15
0
class stopAttack(unittest.TestCase):
    """ Test that stopAttack returns the correct default values """

    def setUp(self):
        """ Builds the ability """
        self.ability = Ability(None)

    def properReturnValues(self):
        """ Check that stopAttack returns the proper default values """
        stop, messages = self.ability.stopAttack(None)
        assert not stop, "Should not stop"
        assert len(messages) == 0, "Messages should have no elements"
Esempio n. 16
0
class onStatus(unittest.TestCase):
    """ Test that onStatus returns the correct default values """

    def setUp(self):
        """ Builds the delegate and side for use in the tests """
        self.ability = Ability(None)

    def properReturnValues(self):
        """ Check that onStatus returns the proper default values """
        messages = self.ability.onStatus(None, None)

        assert len(messages) == 0, "Messages should have no elements"
Esempio n. 17
0
class onStab(unittest.TestCase):
    """ Test that onStab returns the correct mods """

    def setUp(self):
        """ Builds the delegate and side for use in the tests """
        self.ability = Ability(None)

    def properReturnValues(self):
        """ Check that onStatMod returns the proper default values """
        mod = self.ability.onStab()

        assert mod == self.ability.stabMod, "Stab Mod should be default."
Esempio n. 18
0
class onAccuracy(unittest.TestCase):
    """ Test that onAccuracy returns the correct default values """

    def setUp(self):
        """ Builds the ability """
        self.ability = Ability(None)
        self.accuracy = 90

    def properReturnValues(self):
        """ Check that onAccuracy returns the proper default values """
        accuracy = self.ability.onAccuracy(self.accuracy)
        assert accuracy == self.accuracy, "Accuracy should be unaltered."
Esempio n. 19
0
class giveCrit(unittest.TestCase):
    """ Test that giveCrit returns the correct mods """
    def setUp(self):
        """ Builds the delegate and side for use in the tests """
        self.ability = Ability(None)
        self.mod = 2

    def properReturnValues(self):
        """ Check that giveCrit returns the proper default values """
        mod = self.ability.giveCrit(self.mod)

        assert mod == self.mod, "Mod should not be altered."
Esempio n. 20
0
class onContact(unittest.TestCase):
    """ Test that onContact returns the values """
    def setUp(self):
        """ Builds the delegate and side for use in the tests """
        self.pkmn = BuildPokemonBattleWrapper()
        self.attacker = BuildPokemonBattleWrapper()
        self.ability = Ability(None)

    def properReturnValues(self):
        """ Check that onContact returns the proper default values """
        messages = self.ability.onContact(self.pkmn, self.attacker)
        assert messages == [], "Should have no messages."
Esempio n. 21
0
class giveCrit(unittest.TestCase):
    """ Test that giveCrit returns the correct mods """

    def setUp(self):
        """ Builds the delegate and side for use in the tests """
        self.ability = Ability(None)
        self.mod = 2

    def properReturnValues(self):
        """ Check that giveCrit returns the proper default values """
        mod = self.ability.giveCrit(self.mod)

        assert mod == self.mod, "Mod should not be altered."
Esempio n. 22
0
class onContact(unittest.TestCase):
    """ Test that onContact returns the values """

    def setUp(self):
        """ Builds the delegate and side for use in the tests """
        self.pkmn = BuildPokemonBattleWrapper()
        self.attacker = BuildPokemonBattleWrapper()
        self.ability = Ability(None)

    def properReturnValues(self):
        """ Check that onContact returns the proper default values """
        messages = self.ability.onContact(self.pkmn, self.attacker)
        assert messages == [], "Should have no messages."
Esempio n. 23
0
class takeCrit(unittest.TestCase):
    """ Test that takeCrit returns the correct mods """
    def setUp(self):
        """ Builds the delegate and side for use in the tests """
        self.ability = Ability(None)
        self.mod = 2

    def properReturnValues(self):
        """ Check that takeCrit returns the proper default values """
        mod, messages = self.ability.takeCrit(self.mod, None, None)

        assert mod == self.mod, "Mod should not be altered."
        assert len(messages) == 0, "Should have no messages returned."
Esempio n. 24
0
class effectivenessOnDefense(unittest.TestCase):
    """ Test that effectivenessOnDefense returns the correct mods """
    def setUp(self):
        """ Builds the delegate and side for use in the tests """
        self.ability = Ability(None)
        self.mod = 1

    def properReturnValues(self):
        """ Check that effectivenessOnDefense returns the proper default values """
        mod, message = self.ability.effectivenessOnDefense(None, None)

        assert mod == self.mod, "Mod should not be altered."
        assert message is None, "Should have no special message."
Esempio n. 25
0
class takeCrit(unittest.TestCase):
    """ Test that takeCrit returns the correct mods """

    def setUp(self):
        """ Builds the delegate and side for use in the tests """
        self.ability = Ability(None)
        self.mod = 2

    def properReturnValues(self):
        """ Check that takeCrit returns the proper default values """
        mod, messages = self.ability.takeCrit(self.mod, None, None)

        assert mod == self.mod, "Mod should not be altered."
        assert len(messages) == 0, "Should have no messages returned."
Esempio n. 26
0
class effectivenessOnDefense(unittest.TestCase):
    """ Test that effectivenessOnDefense returns the correct mods """

    def setUp(self):
        """ Builds the delegate and side for use in the tests """
        self.ability = Ability(None)
        self.mod = 1

    def properReturnValues(self):
        """ Check that effectivenessOnDefense returns the proper default values """
        mod, message = self.ability.effectivenessOnDefense(None, None)

        assert mod == self.mod, "Mod should not be altered."
        assert message is None, "Should have no special message."
Esempio n. 27
0
class onStatMod(unittest.TestCase):
    """ Test that onStatMod returns the correct default values """
    def setUp(self):
        """ Builds the delegate and side for use in the tests """
        self.ability = Ability(None)
        self.degree = 1

    def properReturnValues(self):
        """ Check that onStatMod returns the proper default values """
        degree, messages = self.ability.onStatMod(None, None, self.degree,
                                                  None)

        assert degree == self.degree, "Degree should be unmodified."
        assert len(messages) == 0, "Messages should have no elements"
Esempio n. 28
0
class onStatMod(unittest.TestCase):
    """ Test that onStatMod returns the correct default values """

    def setUp(self):
        """ Builds the delegate and side for use in the tests """
        self.ability = Ability(None)
        self.degree = 1

    def properReturnValues(self):
        """ Check that onStatMod returns the proper default values """
        degree, messages = self.ability.onStatMod(None, None, self.degree, None)

        assert degree == self.degree, "Degree should be unmodified."
        assert len(messages) == 0, "Messages should have no elements"
Esempio n. 29
0
 def buildStarter(speciesName):
     """ Creates a Pokemon with Starter stats """
     name = speciesName
     species = SpeciesFactory.getSpecies(speciesName)
     level = 5
     pkmn = Pokemon(name, level, species)
     pkmn.id = ""
     
     pkmn.ability = Ability(None)
     pkmn.battleDelegate = PokemonBattleDelegateFactory.buildStarter(pkmn)
     pkmn.displayDelegate = PokemonDisplayDelegateFactory.buildStarter(species)
     # pkmn.experienceDelegate = ExperienceDelegateFactory.loadFromXML(pkmn, tree)
 
     return pkmn
Esempio n. 30
0
 def setUp(self):
     """ Builds the ability """
     self.ability = Ability(None)
Esempio n. 31
0
 def setUp(self):
     """ Builds the delegate and side for use in the tests """
     self.ability = Ability(None)
Esempio n. 32
0
 def setUp(self):
     """ Builds the delegate and side for use in the tests """
     self.ability = Ability(None)
Esempio n. 33
0
 def setUp(self):
     """ Builds the delegate and side for use in the tests """
     self.pkmn = BuildPokemonBattleWrapper()
     self.attacker = BuildPokemonBattleWrapper()
     self.ability = Ability(None)
Esempio n. 34
0
 def setUp(self):
     """ Builds the ability """
     self.pkmn = BuildPokemonBattleWrapper()
     self.ability = Ability(None)
Esempio n. 35
0
 def setUp(self):
     """ Builds the ability """
     self.pkmn = BuildPokemonBattleWrapper()
     self.ability = Ability(None)
Esempio n. 36
0
 def setUp(self):
     """ Builds the ability """
     self.ability = Ability(None)
Esempio n. 37
0
 def setUp(self):
     """ Builds the delegate and side for use in the tests """
     self.pkmn = BuildPokemonBattleWrapper()
     self.attacker = BuildPokemonBattleWrapper()
     self.ability = Ability(None)
Esempio n. 38
0
 def __init__(self, name, types):
     """  """
     Ability.__init__(self, name)
     self.types = types
 def __init__(self, name, types):
     """  """
     Ability.__init__(self, name)
     self.types = types