コード例 #1
0
    def test_does_not_clear_positive_boost(self):
        self.battle.opponent.active.boosts = {constants.ATTACK: 1}
        split_msg = ['-clearnegativeboost', 'p2a: caterpie', '[silent]']
        clearnegativeboost(self.battle, split_msg)

        self.assertEqual(1,
                         self.battle.opponent.active.boosts[constants.ATTACK])
コード例 #2
0
    def test_clears_multiple_negative_boosts(self):
        self.battle.opponent.active.boosts = {
            constants.ATTACK: -1,
            constants.SPEED: -1
        }
        split_msg = ['-clearnegativeboost', 'p2a: caterpie', '[silent]']
        clearnegativeboost(self.battle, split_msg)

        self.assertEqual(0,
                         self.battle.opponent.active.boosts[constants.ATTACK])
        self.assertEqual(0,
                         self.battle.opponent.active.boosts[constants.SPEED])
コード例 #3
0
    def test_clears_only_negative_boosts(self):
        self.battle.opponent.active.boosts = {
            constants.ATTACK: 1,
            constants.SPECIAL_ATTACK: 1,
            constants.SPEED: 1,
            constants.DEFENSE: -1,
            constants.SPECIAL_DEFENSE: -1
        }
        split_msg = ['-clearnegativeboost', 'p2a: caterpie', '[silent]']
        clearnegativeboost(self.battle, split_msg)

        expected_boosts = {
            constants.ATTACK: 1,
            constants.SPECIAL_ATTACK: 1,
            constants.SPEED: 1,
            constants.DEFENSE: 0,
            constants.SPECIAL_DEFENSE: 0
        }

        self.assertEqual(expected_boosts, self.battle.opponent.active.boosts)