コード例 #1
0
ファイル: test.py プロジェクト: arthuro555/pokemonlib
 def test_team_many_pokemon(self):
     identifier = randint(1, 800)
     pokemon = Pokemon(identifier)
     identifier2 = randint(1, 800)
     pokemon2 = Pokemon(identifier2)
     team = Team(pokemon, pokemon2)
     self.assertEqual(team._Team__pokemonlist[0]._Pokemon__id, identifier)
     self.assertEqual(team._Team__pokemonlist[1]._Pokemon__id, identifier2)
コード例 #2
0
ファイル: test.py プロジェクト: arthuro555/pokemonlib
 def test_box_init_many_pokemon(self):
     identifier = randint(1, 800)
     pokemon = Pokemon(identifier)
     identifier2 = randint(1, 800)
     pokemon2 = Pokemon(identifier2)
     box = Box(pokemon, pokemon2)
     self.assertEqual(box._Box__pokemonlist[0]._Pokemon__id, identifier)
     self.assertEqual(box._Box__pokemonlist[1]._Pokemon__id, identifier2)
コード例 #3
0
ファイル: test.py プロジェクト: arthuro555/pokemonlib
 def test_box_team_transfer(self):
     pokemon1 = Pokemon(randint(1, 800))
     pokemon2 = Pokemon(randint(1, 800))
     pokemon3 = Pokemon(randint(1, 800))
     team = Team(pokemon1)
     box1 = Box()
     box2 = Box(pokemon2)
     box2.transfer(team, 0)
     box1.add(pokemon3)
     team.transfer(box1, 1)
     team.transfer(box2, 0)
     self.assertEqual(box2._Box__pokemonlist[0], pokemon1)
     self.assertEqual(box1._Box__pokemonlist[0], pokemon3)
     self.assertEqual(box1._Box__pokemonlist[1], pokemon2)
コード例 #4
0
ファイル: test.py プロジェクト: arthuro555/pokemonlib
 def test_pokemon_stats(self):
     identifier = 25
     pokemon = Pokemon(identifier)
     attacks = {
         1: ["Thunderbolt", 20, True],
         2: ["Poop", 40, True],
         3: ["Earthquake", 40, True],
         4: ["Scratch", 40, True]
     }
     self.assertEqual(
         pokemon.get_stats(), {
             "speed": 90,
             "defsp": 50,
             "attksp": 50,
             "def": 40,
             "attk": 55,
             "hp": 35,
             "attacks": attacks
         })
コード例 #5
0
ファイル: test.py プロジェクト: arthuro555/pokemonlib
 def test_pokemon_init(self):
     identifier = randint(1, 800)
     pokemon = Pokemon(identifier)
     self.assertEqual(pokemon._Pokemon__id, identifier)
コード例 #6
0
ファイル: test.py プロジェクト: arthuro555/pokemonlib
 def test_box_init_one_pokemon(self):
     identifier = randint(1, 800)
     pokemon = Pokemon(identifier)
     box = Box(pokemon)
     self.assertEqual(box._Box__pokemonlist[0]._Pokemon__id, identifier)
コード例 #7
0
ファイル: test.py プロジェクト: arthuro555/pokemonlib
 def test_team_one_pokemon(self):
     identifier = randint(1, 800)
     pokemon = Pokemon(identifier)
     team = Team(pokemon)
     self.assertEqual(team._Team__pokemonlist[0]._Pokemon__id, identifier)
コード例 #8
0
ファイル: test.py プロジェクト: arthuro555/pokemonlib
 def test_pokemon_auto_naming(self):
     identifier = 25
     pokemon = Pokemon(identifier)
     self.assertEqual(pokemon.name, "pikachu")