Beispiel #1
0
 def test_sets_ability_when_the_information_is_present(self):
     split_msg = [
         '', '-heal', 'p2a: Quagsire', '68/100',
         '[from] ability: Water Absorb', '[of] p2a: Genesect'
     ]
     heal_or_damage(self.battle, split_msg)
     self.assertEqual('waterabsorb', self.battle.opponent.active.ability)
Beispiel #2
0
 def test_toxic_count_increases_to_2(self):
     self.battle.opponent.side_conditions[constants.TOXIC_COUNT] = 1
     split_msg = [
         '', '-damage', 'p2a: Caterpie', '94/100 tox', '[from] psn'
     ]
     heal_or_damage(self.battle, split_msg)
     self.assertEqual(
         2, self.battle.opponent.side_conditions[constants.TOXIC_COUNT])
Beispiel #3
0
 def test_damage_caused_by_toxic_increases_side_condition_toxic_counter_for_user(
         self):
     split_msg = [
         '', '-damage', 'p1a: Caterpie', '94/100 tox', '[from] psn'
     ]
     heal_or_damage(self.battle, split_msg)
     self.assertEqual(
         1, self.battle.user.side_conditions[constants.TOXIC_COUNT])
Beispiel #4
0
 def test_damage_caused_by_non_toxic_damage_does_not_increase_toxic_count(
         self):
     split_msg = [
         '', '-damage', 'p2a: Caterpie', '50/100 tox',
         '[from] item: Life Orb'
     ]
     heal_or_damage(self.battle, split_msg)
     self.assertEqual(
         0, self.battle.opponent.side_conditions[constants.TOXIC_COUNT])
Beispiel #5
0
 def test_damage_caused_by_an_item_properly_sets_opponents_item(self):
     split_msg = [
         '', '-damage', 'p2a: Caterpie', '100/100', '[from] item: Life Orb'
     ]
     heal_or_damage(self.battle, split_msg)
     self.assertEqual("lifeorb", self.battle.opponent.active.item)
Beispiel #6
0
 def test_fainted_message_properly_faints_opponents_pokemon(self):
     split_msg = ['', '-damage', 'p2a: Caterpie', '0 fnt']
     heal_or_damage(self.battle, split_msg)
     self.assertEqual(0, self.battle.opponent.active.hp)
Beispiel #7
0
 def test_damage_sets_opponents_active_pokemon_to_correct_hp(self):
     split_msg = ['', '-damage', 'p2a: Caterpie', '80/100']
     heal_or_damage(self.battle, split_msg)
     self.assertEqual(160, self.battle.opponent.active.hp)