Esempio n. 1
0
    def test__extraction(self):
        """Tests init when provided with value for stats dict"""
        test_dict = {"baseAttack": 10, "baseDefense": 20, "baseStamina": 30}
        test_stats = stats.Stats(test_dict)

        self.assertEqual(test_stats.base_attack, 10)
        self.assertEqual(test_stats.base_defense, 20)
        self.assertEqual(test_stats.base_stamina, 30)
Esempio n. 2
0
 def __parse_dict_as_pokemon(self):
     self.name = self.pokemon_dict.get("pokemonId")
     self.number = self.pokemon_dict.get("pokedex").get("pokemonNum")
     self.type1 = self.pokemon_dict.get("type").replace("POKEMON_TYPE_", "")
     self.type2 = None if self.pokemon_dict.get("type2") is None else self.pokemon_dict.get("type2").replace("POKEMON_TYPE_", "")
     self.extras = extras.Extras(self.extras_dict)
     self.stats = stats.Stats(self.pokemon_dict.get("stats"))
     self.movepool = moves.Moves(fast_moves=self.pokemon_dict.get("quickMoves"), charge_moves=self.pokemon_dict.get("cinematicMoves"))
Esempio n. 3
0
    def test__cp_calc_slaking_level_40(self):
        """Tests the cp calc function highest possible cp with level 40 Slaking"""
        test_dict_slaking = {
            "baseAttack": 290,
            "baseDefense": 166,
            "baseStamina": 284
        }
        test_stats_slaking = stats.Stats(test_dict_slaking)

        self.assertEqual(test_stats_slaking.calculate_cp_at_level(40), 4431)
Esempio n. 4
0
    def test__cp_calc_magikarp_level_1(self):
        """Tests the cp calc function floor at cp 10 with level 1 Magikarp"""
        test_dict_magikarp = {
            "baseAttack": 29,
            "baseDefense": 85,
            "baseStamina": 85
        }
        test_stats_magikarp = stats.Stats(test_dict_magikarp)

        self.assertEqual(test_stats_magikarp.calculate_cp_at_level(1), 10)
Esempio n. 5
0
    def test__cp_calc_set_ivs_azumarill(self):
        """Tests the cp calc function with set ivs with level 40 Azumarill"""
        test_dict_azumarill = {
            "baseAttack": 112,
            "baseDefense": 152,
            "baseStamina": 225
        }
        test_stats_azumarill = stats.Stats(test_dict_azumarill)

        self.assertEqual(
            test_stats_azumarill.calculate_cp_at_level(40, 7, 15, 13), 1481)
Esempio n. 6
0
    def test__cp_calc_low_stamina_shedinja(self):
        """Tests the cp calc function with base_stamina at 1 with Shedinja"""
        test_dict_shedinja = {
            "baseAttack": 153,
            "baseDefense": 73,
            "baseStamina": 1
        }
        test_stats_shedinja = stats.Stats(test_dict_shedinja)

        self.assertEqual(test_stats_shedinja.calculate_cp_at_level(1), 10)
        self.assertEqual(test_stats_shedinja.calculate_cp_at_level(30), 337)
Esempio n. 7
0
    def __init__(self, pokemon_dict: dict, extras_dict):
        self.pokemon_dict = pokemon_dict
        self.extras_dict = extras_dict

        self.name = None
        self.number = None
        self.type1 = None
        self.type2 = None
        self.extras: extras.Extras = extras.Extras()
        self.stats: stats.Stats = stats.Stats()
        self.movepool: moves.Moves = moves.Moves()

        # updates the Pokemon´s values
        self.__parse_dict_as_pokemon()
Esempio n. 8
0
 def test__init_default(self):
     """Tests default init"""
     self.assertIsNone(stats.Stats().base_attack)
     self.assertIsNone(stats.Stats().base_defense)
     self.assertIsNone(stats.Stats().base_stamina)