Example #1
0
    def test_sets_protect_side_condition_when_prefixed_by_move(self):
        split_msg = ['', '-singleturn', 'p2a: Caterpie', 'move: Protect']
        singleturn(self.battle, split_msg)

        self.assertEqual(
            2, self.battle.opponent.side_conditions[constants.PROTECT])
Example #2
0
    def test_does_not_set_for_non_protect_move(self):
        split_msg = ['', '-singleturn', 'p2a: Caterpie', 'Roost']
        singleturn(self.battle, split_msg)

        self.assertEqual(
            0, self.battle.opponent.side_conditions[constants.PROTECT])
Example #3
0
    def test_sets_protect_side_condition_for_bot_when_used(self):
        split_msg = ['', '-singleturn', 'p1a: Weedle', 'Protect']
        singleturn(self.battle, split_msg)

        self.assertEqual(2,
                         self.battle.user.side_conditions[constants.PROTECT])
Example #4
0
    def test_sets_protect_side_condition_for_opponent_when_used(self):
        split_msg = ['', '-singleturn', 'p2a: Caterpie', 'Protect']
        singleturn(self.battle, split_msg)

        self.assertEqual(
            2, self.battle.opponent.side_conditions[constants.PROTECT])