Exemple #1
0
    def test_will_play_multiple(self):
        game = TestHelpers().make_game()

        game.players[0].hand = self.make_cards(game.current_player, ArgentSquire(), ArgentSquire(), ArgentSquire())
        game.players[0].mana = 1
        game.players[0].max_mana = 1

        game.play_single_turn()

        self.assert_minions(game.players[0], "Argent Squire", "Argent Squire")
Exemple #2
0
    def test_will_play_biggest(self):
        game = TestHelpers().make_game()

        game.players[0].hand = self.make_cards(game.current_player, ArgentSquire(), ArgentSquire(), DireWolfAlpha())
        game.players[0].mana = 1
        game.players[0].max_mana = 1

        game.play_single_turn()

        self.assert_minions(game.players[0], "Dire Wolf Alpha")
Exemple #3
0
    def test_will_play_multiple_correct_order(self):
        game = TestHelpers().make_game()

        game.players[0].hand = self.make_cards(ArgentSquire(), ArgentSquire(),
                                               ArgentSquire(), HarvestGolem())
        game.players[0].mana = 3
        game.players[0].max_mana = 3

        game.play_single_turn()

        self.assert_minions(game.players[0], "Harvest Golem", "Argent Squire")
Exemple #4
0
 def test_coin_save(self):
     game = self.make_game()
     cards = self.make_cards(game.current_player, ArgentSquire(), MagmaRager(), TheCoin())
     possible_plays = PossiblePlays(cards, 1)
     play = possible_plays.plays()[0]
     names = [c.name for c in play.cards]
     self.assertEqual(names, ["Argent Squire"])
Exemple #5
0
 def test_coin(self):
     game = self.make_game()
     cards = self.make_cards(game.current_player, ArgentSquire(), BloodfenRaptor(), TheCoin())
     possible_plays = PossiblePlays(cards, 1)
     play = possible_plays.plays()[0]
     names = [c.name for c in play.cards]
     self.assertEqual(names, ["The Coin", "Bloodfen Raptor"])
Exemple #6
0
    def test_will_play_three_cards(self):
        game = TestHelpers().make_game()

        self.set_hand(game, 0, Wisp(), ArgentSquire(), DireWolfAlpha())
        self.set_mana(game, 0, 3)

        game.play_single_turn()

        self.assert_minions(game.players[0], "Wisp", "Argent Squire", "Dire Wolf Alpha")
Exemple #7
0
    def test_simple_plays(self):
        game = TestHelpers().make_game()

        self.set_hand(game, 0, ArgentSquire(), DireWolfAlpha(), HarvestGolem())

        game.play_single_turn()

        self.assert_minions(game.players[0], "Argent Squire")

        game.play_single_turn()
        game.play_single_turn()

        self.assert_minions(game.players[0], "Argent Squire", "Dire Wolf Alpha")
Exemple #8
0
    def test_RandomAgent(self):
        deck1 = Deck([
            GoldshireFootman(),
            GoldshireFootman(),
            MurlocRaider(),
            MurlocRaider(),
            BloodfenRaptor(),
            BloodfenRaptor(),
            FrostwolfGrunt(),
            FrostwolfGrunt(),
            RiverCrocolisk(),
            RiverCrocolisk(),
            IronfurGrizzly(),
            IronfurGrizzly(),
            MagmaRager(),
            MagmaRager(),
            SilverbackPatriarch(),
            SilverbackPatriarch(),
            ChillwindYeti(),
            ChillwindYeti(),
            KeeperOfTheGrove(),
            KeeperOfTheGrove(),
            SenjinShieldmasta(),
            SenjinShieldmasta(),
            BootyBayBodyguard(),
            BootyBayBodyguard(),
            FenCreeper(),
            FenCreeper(),
            BoulderfistOgre(),
            BoulderfistOgre(),
            WarGolem(),
            WarGolem(),
        ], Malfurion())

        deck2 = Deck([
            Shieldbearer(),
            Shieldbearer(),
            FlameImp(),
            FlameImp(),
            YoungPriestess(),
            YoungPriestess(),
            DarkIronDwarf(),
            DarkIronDwarf(),
            DireWolfAlpha(),
            DireWolfAlpha(),
            Voidwalker(),
            Voidwalker(),
            HarvestGolem(),
            HarvestGolem(),
            KnifeJuggler(),
            KnifeJuggler(),
            ShatteredSunCleric(),
            ShatteredSunCleric(),
            ArgentSquire(),
            ArgentSquire(),
            Doomguard(),
            Doomguard(),
            Soulfire(),
            Soulfire(),
            DefenderOfArgus(),
            DefenderOfArgus(),
            AbusiveSergeant(),
            AbusiveSergeant(),
            NerubianEgg(),
            NerubianEgg(),
        ], Guldan())

        game = Game([deck1, deck2], [RandomAgent(), RandomAgent()])
        game.pre_game()
        game.current_player = game.players[1]

        game.play_single_turn()

        self.assertEqual(0, len(game.current_player.minions))

        game.play_single_turn()
        self.assertEqual(2, len(game.current_player.minions))
        self.assertEqual(3, game.current_player.minions[1].health)
        self.assertEqual("Young Priestess",
                         game.current_player.minions[0].card.name)

        game.play_single_turn()
        self.assertEqual(1, len(game.current_player.minions))
        self.assertEqual("Frostwolf Grunt",
                         game.current_player.minions[0].card.name)

        game.play_single_turn()
        self.assertEqual(0, len(game.other_player.minions))
        self.assertEqual(28, game.other_player.hero.health)
        self.assertEqual(3, len(game.current_player.minions))
        self.assertEqual("Dire Wolf Alpha",
                         game.current_player.minions[2].card.name)

        for turn in range(0, 13):
            game.play_single_turn()
            self.assertFalse(game.game_ended)

        game.play_single_turn()

        self.assertEqual(0, game.current_player.hero.health)
        self.assertEqual(21, game.other_player.hero.health)

        self.assertTrue(game.game_ended)
    def test_hero_power(self):
        game = self.make_game()
        cards = self.make_cards(game.current_player, ArgentSquire())
        possible_plays = PossiblePlays(cards, 10, allow_hero_power=True)

        self.assertEqual(1, len(possible_plays.plays()))
    def test_hero_power(self):
        cards = [ArgentSquire()]
        possible_plays = PossiblePlays(cards, 10, allow_hero_power=True)

        self.assertEqual(1, len(possible_plays.plays()))