MCPcopy
hub / github.com/PokemonGoF/PokemonGo-Bot / test_pokemons

Method test_pokemons

tests/inventory_test.py:25–159  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

23 self.assertIn(s, t.attack_weak_against)
24
25 def test_pokemons(self):
26 # Init data
27 self.assertEqual(len(Pokemons().all()), 0) # No inventory loaded here
28
29 obj = Pokemons
30 self.assertEqual(len(obj.STATIC_DATA), 251)
31
32 for idx in xrange(len(obj.STATIC_DATA)):
33 pokemon = obj.STATIC_DATA[idx] # type: PokemonInfo
34 name = pokemon.name
35 pokemon_id = pokemon.id
36 self.assertEqual(pokemon.id, idx+1)
37 assert (1 <= pokemon_id <= 251)
38
39 self.assertGreaterEqual(len(pokemon.movesets), 1)
40 self.assertIsInstance(pokemon.movesets[0], Moveset)
41 assert 200 <= pokemon.max_cp <= 4761
42 assert 1 <= len(pokemon.types) <= 2
43 assert 1 <= pokemon.base_attack <= 800
44 assert 20 <= pokemon.base_defense <= 500
45 assert 20 <= pokemon.base_stamina <= 800
46 assert .0 <= pokemon.capture_rate <= .76
47 assert .0 <= pokemon.flee_rate <= .99
48 assert 1 <= len(pokemon._data['Weaknesses']) <= 7
49 assert 3 <= len(name) <= 10
50
51 self.assertGreaterEqual(len(pokemon.classification), 11)
52 self.assertGreaterEqual(len(pokemon.fast_attacks), 1)
53 self.assertGreaterEqual(len(pokemon.charged_attack), 1)
54
55 self.assertIs(obj.data_for(pokemon_id), pokemon)
56 self.assertIs(obj.name_for(pokemon_id), name)
57
58 first_evolution_id = obj.first_evolution_id_for(pokemon_id)
59 self.assertIs(first_evolution_id, pokemon.first_evolution_id)
60 self.assertIs(pokemon.family_id, first_evolution_id)
61 self.assertGreaterEqual(first_evolution_id, 1)
62 next_evolution_ids = obj.next_evolution_ids_for(pokemon_id)
63 self.assertIs(next_evolution_ids, pokemon.next_evolution_ids)
64 last_evolution_ids = obj.last_evolution_ids_for(pokemon_id)
65 self.assertIs(last_evolution_ids, pokemon.last_evolution_ids)
66 candies_cost = obj.evolution_cost_for(pokemon_id)
67 self.assertIs(candies_cost, pokemon.evolution_cost)
68 self.assertIs(obj.prev_evolution_id_for(pokemon_id), pokemon.prev_evolution_id)
69 self.assertGreaterEqual(len(last_evolution_ids), 1)
70
71 if not obj.has_next_evolution(pokemon_id):
72 assert not pokemon.has_next_evolution
73 self.assertEqual(pokemon.evolution_cost, 0)
74 self.assertEqual(pokemon.next_evolution_ids, [])
75 self.assertEqual(pokemon.next_evolutions_all, [])
76 self.assertEqual(pokemon.last_evolution_ids, [pokemon_id])
77 else:
78 self.assertGreater(candies_cost, 0)
79 self.assertGreaterEqual(len(next_evolution_ids), 1)
80 self.assertLessEqual(len(next_evolution_ids), len(last_evolution_ids))
81
82 reqs = pokemon._data['Next Evolution Requirements']

Callers

nothing calls this directly

Calls 11

PokemonsClass · 0.85
PokemonClass · 0.85
evolution_cost_forMethod · 0.80
prev_evolution_id_forMethod · 0.80
allMethod · 0.45
data_forMethod · 0.45
name_forMethod · 0.45
has_next_evolutionMethod · 0.45

Tested by

no test coverage detected