def test_setup_smoke(self):
        game = TestHelpers().make_game()

        self.add_minions(game, 0, Wisp(), WarGolem())
        self.add_minions(game, 1, BloodfenRaptor())

        self.assertEqual(2, len(game.players[0].minions))
        self.assertEqual(1, len(game.players[1].minions))
Beispiel #2
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")
    def test_buff_target(self):
        game = TestHelpers().make_game()

        self.add_minions(game, 0, BloodfenRaptor(), RiverCrocolisk())
        self.make_all_active(game)
        game.players[0].agent.player = game.players[0]
        self.add_minions(game, 0, AbusiveSergeant())

        game.play_single_turn()
Beispiel #4
0
    def test_wont_kill_self_with_hero_power(self):
        game = TestHelpers().make_game()

        self.set_hand(game, 0)
        self.set_mana(game, 0, 2)
        game.players[0].hero.health = 1

        game.play_single_turn()
        self.assert_minions(game.players[0])
        self.assertEqual(game.players[0].hero.health, 1)
Beispiel #5
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")
Beispiel #6
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")
    def test_basic_trade(self):
        game = TestHelpers().make_game()

        self.add_minions(game, 1, Wisp(), WarGolem())
        self.add_minions(game, 0, BloodfenRaptor())

        self.make_all_active(game)
        game.play_single_turn()

        self.assert_minions(game.players[1], "War Golem")
        self.assert_minions(game.players[0], "Bloodfen Raptor")
Beispiel #8
0
    def test_will_use_entire_pool(self):
        game = TestHelpers().make_game()

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

        game.play_single_turn()

        self.assert_minions(game.players[0], "Dire Wolf Alpha", "Dire Wolf Alpha")
Beispiel #9
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")
Beispiel #10
0
    def test_will_respect_taunt(self):
        game = TestHelpers().make_game()

        self.add_minions(game, 1, Wisp(), GoldshireFootman())
        self.add_minions(game, 0, BloodfenRaptor())

        self.make_all_active(game)
        game.play_single_turn()

        self.assert_minions(game.players[1], "Wisp")
        self.assert_minions(game.players[0], "Bloodfen Raptor")
Beispiel #11
0
    def test_will_attack_face(self):
        game = TestHelpers().make_game()

        self.add_minions(game, 0, BloodfenRaptor())

        self.make_all_active(game)
        game.play_single_turn()

        self.assert_minions(game.players[1])
        self.assert_minions(game.players[0], "Bloodfen Raptor")

        self.assertEqual(27, game.players[1].hero.health)
Beispiel #12
0
    def test_will_use_hero_power_with_empty_hand(self):
        game = TestHelpers().make_game()

        self.set_hand(game, 0)
        self.set_mana(game, 0, 10)

        possible = PossiblePlays([], 10)
        play = possible.plays()[0]
        self.assertEqual(play.cards[0].name, "Hero Power")

        game.play_single_turn()
        self.assert_minions(game.players[0], "War Golem")
Beispiel #13
0
    def test_will_attack_twice(self):
        game = TestHelpers().make_game()

        self.add_minions(game, 1, Wisp(), GoldshireFootman())
        self.add_minions(game, 0, BloodfenRaptor(), RiverCrocolisk())

        self.make_all_active(game)
        game.play_single_turn()

        self.assert_minions(game.players[1])
        self.assert_minions(game.players[0], "Bloodfen Raptor",
                            "River Crocolisk")
Beispiel #14
0
    def test_archer_attacks_enemy(self):
        game = TestHelpers().make_game()

        self.set_hand(game, 0, ElvenArcher())
        self.set_board(game, 0, Shieldbearer())
        self.set_board(game, 1, BloodfenRaptor())

        self.make_all_active(game)
        game.play_single_turn()

        self.assert_minions(game.players[0], "Shieldbearer", "Elven Archer")
        self.assertEqual(game.players[1].minions[0].health, 1)
Beispiel #15
0
    def test_abusive(self):
        game = TestHelpers().make_game()

        self.set_hand(game, 0, AbusiveSergeant())
        self.set_board(game, 0, Wisp())
        self.set_board(game, 1, RiverCrocolisk())

        self.make_all_active(game)
        game.play_single_turn()

        self.assert_minions(game.players[0], "Abusive Sergeant")
        self.assert_minions(game.players[1])
Beispiel #16
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")
Beispiel #17
0
    def test_commando_attacks_enemy(self):
        game = TestHelpers().make_game()

        self.set_hand(game, 0, StormpikeCommando())
        self.set_board(game, 0, Wisp())
        self.set_board(game, 1, BloodfenRaptor())
        self.set_mana(game, 0, 5)

        self.make_all_active(game)
        game.play_single_turn()

        self.assert_minions(game.players[0], "Wisp", "Stormpike Commando")
        self.assert_minions(game.players[1])
Beispiel #18
0
    def test_cleric(self):
        game = TestHelpers().make_game()

        self.set_hand(game, 0, ShatteredSunCleric())
        self.set_board(game, 0, Wisp())
        self.set_board(game, 1, BloodfenRaptor())
        self.set_mana(game, 0, 3)

        self.make_all_active(game)
        game.play_single_turn()

        self.assert_minions(game.players[0], "Shattered Sun Cleric")
        self.assert_minions(game.players[1])
Beispiel #19
0
    def test_dwarf(self):
        game = TestHelpers().make_game()

        self.set_hand(game, 0, DarkIronDwarf())
        self.set_board(game, 0, Wisp())
        self.set_board(game, 1, RiverCrocolisk())

        game.players[0].mana = 4
        game.players[0].max_mana = 4

        self.make_all_active(game)
        game.play_single_turn()

        self.assert_minions(game.players[0], "Dark Iron Dwarf")
        self.assert_minions(game.players[1])
Beispiel #20
0
    def test_cleric_buff_to_keep_alive(self):
        # This test does not pass yet. Agent picks a random friendly minion
        return

        game = TestHelpers().make_game()

        self.set_hand(game, 0, ShatteredSunCleric())
        self.set_board(game, 0, MagmaRager(), Wisp())
        self.set_board(game, 1, ImpMaster())
        self.set_mana(game, 0, 3)

        self.make_all_active(game)
        game.play_single_turn()

        self.assert_minions(game.players[0], "Shattered Sun Cleric",
                            "Magma Rager", "Wisp")
        self.assert_minions(game.players[1])
 def make_game(self):
     return TestHelpers().make_game()