Example #1
0
    def test_unboost_works_properly_on_user(self):
        split_msg = ['', 'boost', 'p1a: Caterpie', 'atk', '1']
        unboost(self.battle, split_msg)

        expected_boosts = {constants.ATTACK: -1}

        self.assertEqual(expected_boosts, self.battle.user.active.boosts)
Example #2
0
    def test_unboost_works_properly_on_opponent(self):
        split_msg = ['', 'boost', 'p2a: Weedle', 'atk', '1']
        unboost(self.battle, split_msg)

        expected_boosts = {constants.ATTACK: -1}

        self.assertEqual(expected_boosts, self.battle.opponent.active.boosts)
Example #3
0
    def test_unboost_lowers_one_when_it_hits_the_limit(self):
        self.battle.opponent.active.boosts[constants.ATTACK] = -5
        split_msg = ['', 'unboost', 'p2a: Weedle', 'atk', '2']
        unboost(self.battle, split_msg)

        expected_boosts = {constants.ATTACK: -6}

        self.assertEqual(expected_boosts,
                         dict(self.battle.opponent.active.boosts))
Example #4
0
    def test_unboost_does_not_lower_below_negative_6(self):
        self.battle.opponent.active.boosts[constants.ATTACK] = -6
        split_msg = ['', 'unboost', 'p2a: Weedle', 'atk', '2']
        unboost(self.battle, split_msg)

        expected_boosts = {constants.ATTACK: -6}

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