<s> import random <EOL> import unittest <EOL> from hearthbreaker . agents . basic_agents import PredictableAgent , DoNothingAgent <EOL> from hearthbreaker . constants import CHARACTER_CLASS , MINION_TYPE <EOL> from hearthbreaker . engine import Game <EOL> from hearthbreaker . replay import playback , Replay <EOL> from tests . agents . testing_agents import CardTestingAgent , OneCardPlayingAgent , EnemySpellTestingAgent , MinionAttackingAgent , PlayAndAttackAgent <EOL> from tests . testing_utils import generate_game_for , StackedDeck <EOL> from hearthbreaker . cards import * <EOL> class TestMage ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> random . seed ( <NUM_LIT> ) <EOL> def test_ArcaneMissiles ( self ) : <EOL> game = generate_game_for ( MogushanWarden , ArcaneMissiles , OneCardPlayingAgent , CardTestingAgent ) <EOL> game . play_single_turn ( ) <EOL> game . play_single_turn ( ) <EOL> self . assertEqual ( <NUM_LIT> , game . other_player . hero . health ) <EOL> game . play_single_turn ( ) <EOL> game . play_single_turn ( ) <EOL> game . play_single_turn ( ) <EOL> game . play_single_turn ( ) <EOL> game . play_single_turn ( ) <EOL> self . assertEqual ( <NUM_LIT:1> , len ( game . current_player . minions ) ) <EOL> self . assertEqual ( "<STR_LIT>" , game . current_player . minions [ <NUM_LIT:0> ] . card . name ) <EOL> game . play_single_turn ( ) <EOL> self . assertEqual ( <NUM_LIT:9> , game . other_player . hero . health ) <EOL> self . assertEqual ( <NUM_LIT:4> , game . other_player . minions [ <NUM_LIT:0> ] . health ) <EOL> def test_ArcaneMissilesWithSpellPower ( self ) : <EOL> game = playback ( Replay ( "<STR_LIT>" ) ) <EOL> game . start ( ) <EOL> self . assertEqual ( <NUM_LIT:1> , len ( game . current_player . minions ) ) <EOL> self . assertEqual ( <NUM_LIT:1> , len ( game . other_player . minions ) ) <EOL> self . assertEqual ( <NUM_LIT:1> , game . other_player . minions [ <NUM_LIT:0> ] . health ) <EOL> self . assertEqual ( <NUM_LIT:2> , game . other_player . minions [ <NUM_LIT:0> ] . calculate_max_health ( ) ) <EOL> self . assertEqual ( <NUM_LIT> , game . other_player . hero . health ) <EOL> return game <EOL> def test_WaterElemental ( self ) : <EOL> game = generate_game_for ( WaterElemental , StonetuskBoar , PredictableAgent , DoNothingAgent ) <EOL> for turn in range ( <NUM_LIT:0> , <NUM_LIT:11> ) : <EOL> game . play_single_turn ( ) <EOL> self . assertEqual ( <NUM_LIT> , game . other_player . hero . health ) <EOL> self . assertFalse ( game . other_player . hero . frozen ) <EOL> self . assertEqual ( <NUM_LIT:1> , len ( game . current_player . minions ) ) <EOL> self . assertEqual ( <NUM_LIT:3> , game . current_player . minions [ <NUM_LIT:0> ] . calculate_attack ( ) ) <EOL> self . assertEqual ( <NUM_LIT:6> , game . current_player . minions [ <NUM_LIT:0> ] . health ) <EOL> self . assertEqual ( "<STR_LIT>" , game . current_player . minions [ <NUM_LIT:0> ] . card . name ) <EOL> game . play_single_turn ( ) <EOL> game . play_single_turn ( ) <EOL> self . assertEqual ( <NUM_LIT> , game . other_player . hero . health ) <EOL> self . assertTrue ( game . other_player . hero . frozen ) <EOL> random . seed ( <NUM_LIT> ) <EOL> game = generate_game_for ( WaterElemental , IronbarkProtector , OneCardPlayingAgent , PredictableAgent ) <EOL> for turn in range ( <NUM_LIT:0> , <NUM_LIT:8> ) : <EOL> game . play_single_turn ( ) <EOL> self . assertEqual ( <NUM_LIT:1> , len ( game . other_player . minions ) ) <EOL> self . assertEqual ( <NUM_LIT:5> , game . other_player . minions [ <NUM_LIT:0> ] . health ) <EOL> self . assertEqual ( <NUM_LIT:30> , game . current_player . hero . health ) <EOL> self . assertTrue ( game . current_player . hero . frozen ) <EOL> game . play_single_turn ( ) <EOL> game . play_single_turn ( ) <EOL> self . assertEqual ( <NUM_LIT:30> , game . current_player . hero . health ) <EOL> def test_IceLance ( self ) : <EOL> game = generate_game_for ( IceLance , OasisSnapjaw , CardTestingAgent , OneCardPlayingAgent ) <EOL> game . play_single_turn ( ) <EOL> self . assertTrue ( game . other_player . hero . frozen ) <EOL> self . assertEqual ( <NUM_LIT:30> , game . other_player . hero . health ) <EOL> game . play_single_turn ( ) <EOL> game . play_single_turn ( ) <EOL> self . assertTrue ( game . other_player . hero . frozen ) <EOL> self . assertEqual ( <NUM_LIT> , game . other_player . hero . health ) <EOL> for turn in range ( <NUM_LIT:0> , <NUM_LIT:6> ) : <EOL> game . play_single_turn ( ) <EOL> self . assertEqual ( <NUM_LIT:1> , len ( game . other_player . minions ) ) <EOL> self . assertTrue ( game . other_player . minions [ <NUM_LIT:0> ] . frozen ) <EOL> self . assertEqual ( <NUM_LIT:7> , game . other_player . minions [ <NUM_LIT:0> ] . health ) <EOL> def test_ManaWyrm ( self ) : <EOL> deck1 = StackedDeck ( [ ManaWyrm ( ) , IceLance ( ) , ManaWyrm ( ) , IceLance ( ) , IceLance ( ) , IceLance ( ) ] , <EOL> CHARACTER_CLASS . MAGE ) <EOL> deck2 = StackedDeck ( [ IronbeakOwl ( ) ] , CHARACTER_CLASS . PALADIN ) <EOL> game = Game ( [ deck1 , deck2 ] , [ CardTestingAgent ( ) , OneCardPlayingAgent ( ) ] ) <EOL> game . pre_game ( ) <EOL> game . current_player = <NUM_LIT:1> <EOL> game . play_single_turn ( ) <EOL> self . assertEqual ( <NUM_LIT:1> , len ( game . current_player . minions ) ) <EOL> self . assertEqual ( <NUM_LIT:1> , game . current_player . minions [ <NUM_LIT:0> ] . calculate_attack ( ) ) <EOL> self . assertEqual ( <NUM_LIT:3> , game . current_player . minions [ <NUM_LIT:0> ] . health ) <EOL> self . assertEqual ( <NUM_LIT:3> , game . current_player . minions [ <NUM_LIT:0> ] . calculate_max_health ( ) ) <EOL> self . assertEqual ( "<STR_LIT>" , game . current_player . minions [ <NUM_LIT:0> ] . card . name ) <EOL> game . play_single_turn ( ) <EOL> game . play_single_turn ( ) <EOL> self . assertEqual ( <NUM_LIT:2> , len ( game . current_player . minions ) ) <EOL> self . assertEqual ( <NUM_LIT:1> , game . current_player . minions [ <NUM_LIT:0> ] . calculate_attack ( ) ) <EOL> self . assertEqual ( <NUM_LIT:3> , game . current_player . minions [ <NUM_LIT:0> ] . health ) <EOL> self . assertEqual ( <NUM_LIT:3> , game . current_player . minions [ <NUM_LIT:0> ] . calculate_max_health ( ) ) <EOL> self . assertEqual ( <NUM_LIT:2> , game . current_player . minions [ <NUM_LIT:1> ] . calculate_attack ( ) ) <EOL> self . assertEqual ( <NUM_LIT:3> , game . current_player . minions [ <NUM_LIT:1> ] . health ) <EOL> self . assertEqual ( <NUM_LIT:3> , game . current_player . minions [ <NUM_LIT:1> ] . calculate_max_health ( ) ) <EOL> game . play_single_turn ( ) <EOL> game . play_single_turn ( ) <EOL> self . assertEqual ( <NUM_LIT:2> , len ( game . current_player . minions ) ) <EOL> self . assertEqual ( <NUM_LIT:1> , game . current_player . minions [ <NUM_LIT:0> ] . calculate_attack ( ) ) <EOL> self . assertEqual ( <NUM_LIT:3> , game . current_player . minions [ <NUM_LIT:0> ] . health ) <EOL> self . assertEqual ( <NUM_LIT:3> , game . current_player . minions [ <NUM_LIT:0> ] . calculate_max_health ( ) ) <EOL> self . assertEqual ( <NUM_LIT:5> , game . current_player . minions [ <NUM_LIT:1> ] . calculate_attack ( ) ) <EOL> self . assertEqual ( <NUM_LIT:3> , game . current_player . minions [ <NUM_LIT:1> ] . health ) <EOL> self . assertEqual ( <NUM_LIT:3> , game . current_player . minions [ <NUM_LIT:1> ] . calculate_max_health ( ) ) <EOL> def test_MirrorImage ( self ) : <EOL> game = generate_game_for ( MirrorImage , StonetuskBoar , CardTestingAgent , DoNothingAgent ) <EOL> game . play_single_turn ( ) <EOL> self . assertEqual ( <NUM_LIT:2> , len ( game . current_player . minions ) ) <EOL> self . assertEqual ( <NUM_LIT:0> , game . current_player . minions [ <NUM_LIT:0> ] . calculate_attack ( ) ) <EOL> self . assertEqual ( <NUM_LIT:2> , game . current_player . minions [ <NUM_LIT:0> ] . health ) <EOL> self . assertTrue ( game . current_player . minions [ <NUM_LIT:0> ] . taunt ) <EOL> self . assertEqual ( "<STR_LIT>" , game . current_player . minions [ <NUM_LIT:0> ] . card . name ) <EOL> self . assertEqual ( <NUM_LIT:0> , game . current_player . minions [ <NUM_LIT:0> ] . card . mana ) <EOL> self . assertEqual ( <NUM_LIT:0> , game . current_player . minions [ <NUM_LIT:1> ] . calculate_attack ( ) ) <EOL> self . assertEqual ( <NUM_LIT:2> , game . current_player . minions [ <NUM_LIT:1> ] . health ) <EOL> self . assertTrue ( game . current_player . minions [ <NUM_LIT:1> ] . taunt ) <EOL> self . assertEqual ( "<STR_LIT>" , game . current_player . minions [ <NUM_LIT:1> ] . card . name ) <EOL> self . assertEqual ( <NUM_LIT:0> , game . current_player . minions [ <NUM_LIT:1> ] . card . mana ) <EOL> def test_ArcaneExplosion ( self ) : <EOL> game = generate_game_for ( BloodfenRaptor , ArcaneExplosion , OneCardPlayingAgent , CardTestingAgent ) <EOL> game . play_single_turn ( ) <EOL> game . play_single_turn ( ) <EOL> game . play_single_turn ( ) <EOL> self . assertEqual ( <NUM_LIT:1> , len ( game . current_player . minions ) ) <EOL> game . play_single_turn ( ) <EOL> self . assertEqual ( <NUM_LIT:1> , len ( game . other_player . minions ) ) <EOL> self . assertEqual ( <NUM_LIT:1> , game . other_player . minions [ <NUM_LIT:0> ] . health ) <EOL> self . assertEqual ( <NUM_LIT:30> , game . other_player . hero . health ) <EOL> game . play_single_turn ( ) <EOL> game . play_single_turn ( ) <EOL> self . assertEqual ( <NUM_LIT:1> , len ( game . other_player . minions ) ) <EOL> self . assertEqual ( <NUM_LIT:1> , game . other_player . minions [ <NUM_LIT:0> ] . health ) <EOL> self . assertEqual ( <NUM_LIT:30> , game . other_player . hero . health ) <EOL> def test_Frostbolt ( self ) : <EOL> game = generate_game_for ( OasisSnapjaw , Frostbolt , OneCardPlayingAgent , CardTestingAgent ) <EOL> for turn in range ( <NUM_LIT:0> , <NUM_LIT:4> ) : <EOL> game . play_single_turn ( ) <EOL> self . assertTrue ( game . other_player . hero . frozen ) <EOL> self . assertEqual ( <NUM_LIT> , game . other_player . hero . health ) <EOL> for turn in range ( <NUM_LIT:0> , <NUM_LIT:4> ) : <EOL> game . play_single_turn ( ) <EOL> self . assertEqual ( <NUM_LIT> , game . other_player . hero . health ) <EOL> self . assertEqual ( <NUM_LIT:1> , len ( game . other_player . minions ) ) <EOL> self . assertEqual ( <NUM_LIT:1> , game . other_player . minions [ <NUM_LIT:0> ] . health ) <EOL> self . assertTrue ( game . other_player . minions [ <NUM_LIT:0> ] . frozen ) <EOL> def test_SorcerersApprentice ( self ) : <EOL> game = generate_game_for ( [ SorcerersApprentice , ArcaneMissiles , SorcerersApprentice , Frostbolt , Frostbolt , <EOL> Frostbolt ] , StonetuskBoar , CardTestingAgent , DoNothingAgent ) <EOL> game . play_single_turn ( ) <EOL> game . play_single_turn ( ) <EOL> game . play_single_turn ( ) <EOL> self . assertEqual ( <NUM_LIT:1> , len ( game . current_player . minions ) ) <EOL> self . assertEqual ( <NUM_LIT:3> , game . current_player . minions [ <NUM_LIT:0> ] . calculate_attack ( ) ) <EOL> self . assertEqual ( <NUM_LIT:2> , game . current_player . minions [ <NUM_LIT:0> ] . health ) <EOL> self . assertEqual ( "<STR_LIT>" , game . current_player . minions [ <NUM_LIT:0> ] . card . name ) <EOL> self . assertEqual ( <NUM_LIT> , game . other_player . hero . health ) <EOL> self . assertEqual ( <NUM_LIT:1> , game . current_player . hand [ <NUM_LIT:1> ] . mana_cost ( ) ) <EOL> self . assertEqual ( <NUM_LIT:1> , game . current_player . hand [ <NUM_LIT:2> ] . mana_cost ( ) ) <EOL> game . play_single_turn ( ) <EOL> game . play_single_turn ( ) <EOL> self . assertEqual ( <NUM_LIT:0> , len ( game . current_player . minions ) ) <EOL> self . assertEqual ( <NUM_LIT:2> , game . current_player . hand [ <NUM_LIT:0> ] . mana_cost ( ) ) <EOL> def test_ArcaneIntellect ( self ) : <EOL> game = generate_game_for ( ArcaneIntellect , StonetuskBoar , CardTestingAgent , DoNothingAgent ) <EOL> for turn in range ( <NUM_LIT:0> , <NUM_LIT:5> ) : <EOL> game . play_single_turn ( ) <EOL> self . assertEqual ( <NUM_LIT:7> , len ( game . current_player . hand ) ) <EOL> def test_FrostNova ( self ) : <EOL> game = generate_game_for ( FrostNova , StonetuskBoar , CardTestingAgent , OneCardPlayingAgent ) <EOL> for turn in range ( <NUM_LIT:0> , <NUM_LIT:5> ) : <EOL> game . play_single_turn ( ) <EOL> for minion in game . other_player . minions : <EOL> self . assertTrue ( minion . frozen ) <EOL> self . assertFalse ( game . other_player . hero . frozen ) <EOL> def test_Counterspell ( self ) : <EOL> game = generate_game_for ( Counterspell , Frostbolt , CardTestingAgent , CardTestingAgent ) <EOL> for turn in range ( <NUM_LIT:0> , <NUM_LIT:5> ) : <EOL> game . play_single_turn ( ) <EOL> self . assertEqual ( <NUM_LIT:1> , len ( game . current_player . secrets ) ) <EOL> self . assertEqual ( "<STR_LIT>" , game . current_player . secrets [ <NUM_LIT:0> ] . name ) <EOL> game . play_single_turn ( ) <EOL> self . assertFalse ( game . other_player . hero . frozen ) <EOL> self . assertEqual ( <NUM_LIT> , game . other_player . hero . health ) <EOL> self . assertEqual ( <NUM_LIT:0> , len ( game . other_player . secrets ) ) <EOL> def test_IceBarrier ( self ) : <EOL> game = generate_game_for ( IceBarrier , StonetuskBoar , CardTestingAgent , PredictableAgent ) <EOL> for turn in range ( <NUM_LIT:0> , <NUM_LIT:5> ) : <EOL> game . play_single_turn ( ) <EOL> self . assertEqual ( <NUM_LIT:1> , len ( game . current_player . secrets ) ) <EOL> self . assertEqual ( "<STR_LIT>" , game . current_player . secrets [ <NUM_LIT:0> ] . name ) <EOL> game . play_single_turn ( ) <EOL> self . assertEqual ( <NUM_LIT:1> , len ( game . current_player . minions ) ) <EOL> self . assertEqual ( <NUM_LIT:7> , game . other_player . hero . armor ) <EOL> self . assertEqual ( <NUM_LIT> , game . other_player . hero . health ) <EOL> random . seed ( <NUM_LIT> ) <EOL> game = generate_game_for ( IceBarrier , StonetuskBoar , CardTestingAgent , DoNothingAgent ) <EOL> for turn in range ( <NUM_LIT:0> , <NUM_LIT:6> ) : <EOL> game . play_single_turn ( ) <EOL> self . assertEqual ( <NUM_LIT:1> , len ( game . other_player . secrets ) ) <EOL> self . assertEqual ( "<STR_LIT>" , game . other_player . secrets [ <NUM_LIT:0> ] . name ) <EOL> game . play_single_turn ( ) <EOL> self . assertEqual ( <NUM_LIT:1> , len ( game . current_player . secrets ) ) <EOL> self . assertEqual ( "<STR_LIT>" , game . current_player . secrets [ <NUM_LIT:0> ] . name ) <EOL> def test_IceBlock ( self ) : <EOL> game = generate_game_for ( [ IceBlock , Deathwing ] , Frostbolt , CardTestingAgent , CardTestingAgent ) <EOL> for turn in range ( <NUM_LIT:0> , <NUM_LIT:12> ) : <EOL> game . play_single_turn ( ) <EOL> self . assertEqual ( game . other_player . hero . health , <NUM_LIT:3> ) <EOL> self . assertEqual ( <NUM_LIT:1> , len ( game . other_player . secrets ) ) <EOL> game . play_single_turn ( ) <EOL> game . play_single_turn ( ) <EOL> self . assertEqual ( <NUM_LIT:3> , game . other_player . hero . health ) <EOL> self . assertEqual ( <NUM_LIT:0> , len ( game . other_player . secrets ) ) <EOL> game . play_single_turn ( ) <EOL> game . play_single_turn ( ) <EOL> self . assertTrue ( game . game_ended ) <EOL> def test_MirrorEntity ( self ) : <EOL> game = generate_game_for ( [ StonetuskBoar , MirrorEntity ] , IronfurGrizzly , CardTestingAgent , OneCardPlayingAgent ) <EOL> for turn in range ( <NUM_LIT:0> , <NUM_LIT:5> ) : <EOL> game . play_single_turn ( ) <EOL> self . assertEqual ( <NUM_LIT:1> , len ( game . current_player . secrets ) ) <EOL> self . assertEqual ( "<STR_LIT>" , game . current_player . secrets [ <NUM_LIT:0> ] . name ) <EOL> game . play_single_turn ( ) <EOL> self . assertEqual ( <NUM_LIT:2> , len ( game . other_player . minions ) ) <EOL> self . assertEqual ( "<STR_LIT>" , game . other_player . minions [ <NUM_LIT:1> ] . card . name ) <EOL> self . assertEqual ( game . other_player , game . other_player . minions [ <NUM_LIT:1> ] . player ) <EOL> self . assertEqual ( <NUM_LIT:1> , game . other_player . minions [ <NUM_LIT:1> ] . index ) <EOL> def test_Spellbender ( self ) : <EOL> game = generate_game_for ( [ Spellbender , Wisp ] , Moonfire , CardTestingAgent , CardTestingAgent ) <EOL> for turn in range ( <NUM_LIT:0> , <NUM_LIT:6> ) : <EOL> game . play_single_turn ( ) <EOL> self . assertEqual ( <NUM_LIT:2> , len ( game . other_player . minions ) ) <EOL> self . assertEqual ( <NUM_LIT:2> , game . other_player . minions [ <NUM_LIT:1> ] . health ) <EOL> self . assertEqual ( <NUM_LIT:1> , game . other_player . minions [ <NUM_LIT:1> ] . calculate_attack ( ) ) <EOL> self . assertEqual ( "<STR_LIT>" , game . other_player . minions [ <NUM_LIT:1> ] . card . name ) <EOL> random . seed ( <NUM_LIT> ) <EOL> game = generate_game_for ( Spellbender , Moonfire , CardTestingAgent , CardTestingAgent ) <EOL> for turn in range ( <NUM_LIT:0> , <NUM_LIT:6> ) : <EOL> game . play_single_turn ( ) <EOL> self . assertEqual ( <NUM_LIT:0> , len ( game . other_player . minions ) ) <EOL> self . assertEqual ( <NUM_LIT:1> , len ( game . other_player . secrets ) ) <EOL> self . assertEqual ( <NUM_LIT> , game . other_player . hero . health ) <EOL> random . seed ( <NUM_LIT> ) <EOL> game = generate_game_for ( Spellbender , ArcaneIntellect , CardTestingAgent , CardTestingAgent ) <EOL> for turn in range ( <NUM_LIT:0> , <NUM_LIT:6> ) : <EOL> game . play_single_turn ( ) <EOL> self . assertEqual ( <NUM_LIT:0> , len ( game . other_player . minions ) ) <EOL> self . assertEqual ( <NUM_LIT:1> , len ( game . other_player . secrets ) ) <EOL> def test_SpellbenderFullBoard ( self ) : <EOL> game = generate_game_for ( [ Spellbender , Onyxia ] , Assassinate , OneCardPlayingAgent , OneCardPlayingAgent ) <EOL> for turn in range ( <NUM_LIT> ) : <EOL> game . play_single_turn ( ) <EOL> self . assertEqual ( <NUM_LIT:1> , len ( game . current_player . secrets ) ) <EOL> self . assertEqual ( <NUM_LIT:7> , len ( game . current_player . minions ) ) <EOL> game . play_single_turn ( ) <EOL> self . assertEqual ( <NUM_LIT:6> , len ( game . other_player . minions ) ) <EOL> self . assertEqual ( <NUM_LIT:1> , len ( game . other_player . secrets ) ) <EOL> def test_Spellbender_full_board_target_hero ( self ) : <EOL> game = generate_game_for ( BaneOfDoom , [ Wisp , Wisp , Wisp , Wisp , Wisp , Wisp , Wisp , Spellbender ] , <EOL> OneCardPlayingAgent , CardTestingAgent ) <EOL> for turn in range ( <NUM_LIT:10> ) : <EOL> game . play_single_turn ( ) <EOL> self . assertEqual ( <NUM_LIT:7> , len ( game . current_player . minions ) ) <EOL> self . assertEqual ( <NUM_LIT:1> , len ( game . current_player . secrets ) ) <EOL> game . other_player . agent . choose_target = lambda targets : game . players [ <NUM_LIT:1> ] . hero <EOL> game . play_single_turn ( ) <EOL> self . assertEqual ( <NUM_LIT:7> , len ( game . other_player . minions ) ) <EOL> self . assertEqual ( <NUM_LIT> , game . other_player . hero . health ) <EOL> self . assertEqual ( <NUM_LIT:1> , len ( game . other_player . secrets ) ) <EOL> def test_Spellbender_target_hero_and_attack ( self ) : <EOL> game = generate_game_for ( [ Spellbender , OasisSnapjaw ] , [ LavaBurst , Wisp , Loatheb ] , <EOL> OneCardPlayingAgent , PlayAndAttackAgent ) <EOL> for turn in range ( <NUM_LIT:5> ) : <EOL> game . play_single_turn ( ) <EOL> self . assertEqual ( <NUM_LIT:1> , len ( game . current_player . secrets ) ) <EOL> self . assertEqual ( <NUM_LIT:0> , len ( game . other_player . minions ) ) <EOL> game . play_single_turn ( ) <EOL> self . assertEqual ( <NUM_LIT:1> , len ( game . other_player . secrets ) ) <EOL> self . assertEqual ( <NUM_LIT:1> , len ( game . current_player . minions ) ) <EOL> self . assertEqual ( <NUM_LIT> , game . other_player . hero . health ) <EOL> game . play_single_turn ( ) <EOL> game . play_single_turn ( ) <EOL> self . assertEqual ( <NUM_LIT> , game . other_player . hero . health ) <EOL> self . assertEqual ( <NUM_LIT:1> , len ( game . other_player . minions ) ) <EOL> self . assertEqual ( <NUM_LIT:6> , game . other_player . minions [ <NUM_LIT:0> ] . health ) <EOL> self . assertEqual ( <NUM_LIT:1> , len ( game . other_player . secrets ) ) <EOL> def test_Vaporize ( self ) : <EOL> game = generate_game_for ( Vaporize , FaerieDragon , CardTestingAgent , MinionAttackingAgent ) <EOL> for turn in range ( <NUM_LIT:0> , <NUM_LIT:6> ) : <EOL> game . play_single_turn ( ) <EOL> self . assertEqual ( <NUM_LIT:1> , len ( game . current_player . minions ) ) <EOL> self . assertEqual ( <NUM_LIT:0> , len ( game . other_player . secrets ) ) <EOL> self . assertEqual ( <NUM_LIT:30> , game . other_player . hero . health ) <EOL> random . seed ( <NUM_LIT> ) <EOL> game = generate_game_for ( Vaporize , Swipe , CardTestingAgent , PredictableAgent ) <EOL> for turn in range ( <NUM_LIT:0> , <NUM_LIT:6> ) : <EOL> game . play_single_turn ( ) <EOL> self . assertEqual ( <NUM_LIT> , game . other_player . hero . health ) <EOL> self . assertEqual ( <NUM_LIT:1> , len ( game . other_player . secrets ) ) <EOL> self . assertFalse ( game . current_player . hero . dead ) <EOL> def test_KirinTorMage ( self ) : <EOL> game = generate_game_for ( [ KirinTorMage , Vaporize , Spellbender ] , StonetuskBoar , <EOL> CardTestingAgent , DoNothingAgent ) <EOL> for turn in range ( <NUM_LIT:0> , <NUM_LIT:5> ) : <EOL> game . play_single_turn ( ) <EOL> self . assertEqual ( <NUM_LIT:1> , len ( game . current_player . secrets ) ) <EOL> self . assertEqual ( "<STR_LIT>" , game . current_player . secrets [ <NUM_LIT:0> ] . name ) <EOL> self . assertEqual ( <NUM_LIT:1> , len ( game . current_player . minions ) ) <EOL> self . assertEqual ( "<STR_LIT>" , game . current_player . minions [ <NUM_LIT:0> ] . card . name ) <EOL> self . assertEqual ( <NUM_LIT:3> , game . current_player . hand [ <NUM_LIT:0> ] . mana_cost ( ) ) <EOL> self . assertEqual ( "<STR_LIT>" , game . current_player . hand [ <NUM_LIT:0> ] . name ) <EOL> random . seed ( <NUM_LIT> ) <EOL> game = generate_game_for ( [ KirinTorMage , Vaporize ] , StonetuskBoar , OneCardPlayingAgent , DoNothingAgent ) <EOL> for turn in range ( <NUM_LIT:0> , <NUM_LIT:5> ) : <EOL> game . play_single_turn ( ) <EOL> self . assertEqual ( <NUM_LIT:0> , len ( game . current_player . secrets ) ) <EOL> self . assertEqual ( <NUM_LIT:1> , len ( game . current_player . minions ) ) <EOL> self . assertEqual ( "<STR_LIT>" , game . current_player . minions [ <NUM_LIT:0> ] . card . name ) <EOL> self . assertEqual ( <NUM_LIT:3> , game . current_player . hand [ <NUM_LIT:2> ] . mana_cost ( ) ) <EOL> self . assertEqual ( "<STR_LIT>" , game . current_player . hand [ <NUM_LIT:2> ] . name ) <EOL> def test_EtherealArcanist ( self ) : <EOL> game = generate_game_for ( [ Spellbender , EtherealArcanist ] , StonetuskBoar , CardTestingAgent , DoNothingAgent ) <EOL> for turn in range ( <NUM_LIT:0> , <NUM_LIT:6> ) : <EOL> game . play_single_turn ( ) <EOL> self . assertEqual ( <NUM_LIT:1> , len ( game . other_player . secrets ) ) <EOL> game . play_single_turn ( ) <EOL> self . assertEqual ( <NUM_LIT:1> , len ( game . current_player . minions ) ) <EOL> self . assertEqual ( <NUM_LIT:5> , game . current_player . minions [ <NUM_LIT:0> ] . calculate_attack ( ) ) <EOL> self . assertEqual ( <NUM_LIT:5> , game . current_player . minions [ <NUM_LIT:0> ] . health ) <EOL> self . assertEqual ( <NUM_LIT:5> , game . current_player . minions [ <NUM_LIT:0> ] . calculate_max_health ( ) ) <EOL> game . play_single_turn ( ) <EOL> game . play_single_turn ( ) <EOL> self . assertEqual ( <NUM_LIT:7> , game . current_player . minions [ <NUM_LIT:0> ] . calculate_attack ( ) ) <EOL> self . assertEqual ( <NUM_LIT:7> , game . current_player . minions [ <NUM_LIT:0> ] . health ) <EOL> self . assertEqual ( <NUM_LIT:7> , game . current_player . minions [ <NUM_LIT:0> ] . calculate_max_health ( ) ) <EOL> game . current_player . minions [ <NUM_LIT:0> ] . silence ( ) <EOL> self . assertEqual ( <NUM_LIT:3> , game . current_player . minions [ <NUM_LIT:0> ] . calculate_attack ( ) ) <EOL> self . assertEqual ( <NUM_LIT:3> , game . current_player . minions [ <NUM_LIT:0> ] . health ) <EOL> self . assertEqual ( <NUM_LIT:3> , game . current_player . minions [ <NUM_LIT:0> ] . calculate_max_health ( ) ) <EOL> game . play_single_turn ( ) <EOL> game . play_single_turn ( ) <EOL> self . assertEqual ( <NUM_LIT:3> , game . current_player . minions [ <NUM_LIT:0> ] . calculate_attack ( ) ) <EOL> self . assertEqual ( <NUM_LIT:3> , game . current_player . minions [ <NUM_LIT:0> ] . health ) <EOL> self . assertEqual ( <NUM_LIT:3> , game . current_player . minions [ <NUM_LIT:0> ] . calculate_max_health ( ) ) <EOL> random . seed ( <NUM_LIT> ) <EOL> game = generate_game_for ( EtherealArcanist , StonetuskBoar , CardTestingAgent , DoNothingAgent ) <EOL> for turn in range ( <NUM_LIT:0> , <NUM_LIT:7> ) : <EOL> game . play_single_turn ( ) <EOL> self . assertEqual ( <NUM_LIT:1> , len ( game . current_player . minions ) ) <EOL> self . assertEqual ( <NUM_LIT:3> , game . current_player . minions [ <NUM_LIT:0> ] . calculate_attack ( ) ) <EOL> self . assertEqual ( <NUM_LIT:3> , game . current_player . minions [ <NUM_LIT:0> ] . health ) <EOL> self . assertEqual ( <NUM_LIT:3> , game . current_player . minions [ <NUM_LIT:0> ] . calculate_max_health ( ) ) <EOL> def test_ConeOfCold ( self ) : <EOL> game = generate_game_for ( ConeOfCold , [ StonetuskBoar , BloodfenRaptor , BloodfenRaptor ] , CardTestingAgent , <EOL> OneCardPlayingAgent ) <EOL> for turn in range ( <NUM_LIT:0> , <NUM_LIT:6> ) : <EOL> game . play_single_turn ( ) <EOL> self . assertEqual ( <NUM_LIT:3> , len ( game . current_player . minions ) ) <EOL> game . play_single_turn ( ) <EOL> self . assertEqual ( <NUM_LIT:3> , len ( game . other_player . minions ) ) <EOL> self . assertTrue ( game . other_player . minions [ <NUM_LIT:0> ] . frozen ) <EOL> self . assertEqual ( <NUM_LIT:1> , game . other_player . minions [ <NUM_LIT:0> ] . health ) <EOL> self . assertTrue ( game . other_player . minions [ <NUM_LIT:1> ] . frozen ) <EOL> self . assertEqual ( <NUM_LIT:1> , game . other_player . minions [ <NUM_LIT:1> ] . health ) <EOL> self . assertFalse ( game . other_player . minions [ <NUM_LIT:2> ] . frozen ) <EOL> self . assertEqual ( <NUM_LIT:1> , game . other_player . minions [ <NUM_LIT:2> ] . health ) <EOL> self . assertEqual ( <NUM_LIT:30> , game . other_player . hero . health ) <EOL> game . current_player . agent . choose_target = lambda targets : targets [ len ( targets ) - <NUM_LIT:1> ] <EOL> game . play_single_turn ( ) <EOL> game . play_single_turn ( ) <EOL> self . assertEqual ( <NUM_LIT:2> , len ( game . other_player . minions ) ) <EOL> self . assertFalse ( game . other_player . minions [ <NUM_LIT:0> ] . frozen ) <EOL> self . assertFalse ( game . other_player . minions [ <NUM_LIT:1> ] . frozen ) <EOL> def test_Fireball ( self ) : <EOL> game = generate_game_for ( [ Fireball , KoboldGeomancer ] , StonetuskBoar , EnemySpellTestingAgent , DoNothingAgent ) <EOL> for turn in range ( <NUM_LIT:0> , <NUM_LIT:7> ) : <EOL> game . play_single_turn ( ) <EOL> self . assertEqual ( <NUM_LIT> , game . other_player . hero . health ) <EOL> for turn in range ( <NUM_LIT:0> , <NUM_LIT:4> ) : <EOL> game . play_single_turn ( ) <EOL> self . assertEqual ( <NUM_LIT> , game . other_player . hero . health ) <EOL> def test_Polymorph ( self ) : <EOL> game = generate_game_for ( MogushanWarden , Polymorph , OneCardPlayingAgent , CardTestingAgent ) <EOL> for turn in range ( <NUM_LIT:0> , <NUM_LIT:7> ) : <EOL> game . play_single_turn ( ) <EOL> self . assertEqual ( <NUM_LIT:1> , len ( game . current_player . minions ) ) <EOL> self . assertTrue ( game . current_player . minions [ <NUM_LIT:0> ] . taunt ) <EOL> self . assertEqual ( <NUM_LIT:1> , game . current_player . minions [ <NUM_LIT:0> ] . calculate_attack ( ) ) <EOL> self . assertEqual ( <NUM_LIT:7> , game . current_player . minions [ <NUM_LIT:0> ] . health ) <EOL> self . assertEqual ( "<STR_LIT>" , game . current_player . minions [ <NUM_LIT:0> ] . card . name ) <EOL> game . play_single_turn ( ) <EOL> self . assertEqual ( <NUM_LIT:1> , len ( game . other_player . minions ) ) <EOL> self . assertFalse ( game . other_player . minions [ <NUM_LIT:0> ] . taunt ) <EOL> self . assertEqual ( <NUM_LIT:1> , game . other_player . minions [ <NUM_LIT:0> ] . calculate_attack ( ) ) <EOL> self . assertEqual ( <NUM_LIT:1> , game . other_player . minions [ <NUM_LIT:0> ] . health ) <EOL> self . assertEqual ( "<STR_LIT>" , game . other_player . minions [ <NUM_LIT:0> ] . card . name ) <EOL> self . assertEqual ( MINION_TYPE . BEAST , game . other_player . minions [ <NUM_LIT:0> ] . card . minion_type ) <EOL> def test_Blizzard ( self ) : <EOL> game = generate_game_for ( Blizzard , MogushanWarden , CardTestingAgent , OneCardPlayingAgent ) <EOL> for turn in range ( <NUM_LIT:0> , <NUM_LIT:10> ) : <EOL> game . play_single_turn ( ) <EOL> self . assertEqual ( <NUM_LIT:2> , len ( game . current_player . minions ) ) <EOL> self . assertEqual ( <NUM_LIT:7> , game . current_player . minions [ <NUM_LIT:0> ] . health ) <EOL> self . assertEqual ( <NUM_LIT:7> , game . current_player . minions [ <NUM_LIT:1> ] . health ) <EOL> self . assertFalse ( game . current_player . minions [ <NUM_LIT:0> ] . frozen ) <EOL> self . assertFalse ( game . current_player . minions [ <NUM_LIT:1> ] . frozen ) <EOL> game . play_single_turn ( ) <EOL> self . assertEqual ( <NUM_LIT:2> , len ( game . other_player . minions ) ) <EOL> self . assertEqual ( <NUM_LIT:5> , game . other_player . minions [ <NUM_LIT:0> ] . health ) <EOL> self . assertEqual ( <NUM_LIT:5> , game . other_player . minions [ <NUM_LIT:1> ] . health ) <EOL> self . assertTrue ( game . other_player . minions [ <NUM_LIT:0> ] . frozen ) <EOL> self . assertTrue ( game . other_player . minions [ <NUM_LIT:1> ] . frozen ) <EOL> def test_Flamestrike ( self ) : <EOL> game = generate_game_for ( Flamestrike , MogushanWarden , CardTestingAgent , OneCardPlayingAgent ) <EOL> for turn in range ( <NUM_LIT:0> , <NUM_LIT:12> ) : <EOL> game . play_single_turn ( ) <EOL> self . assertEqual ( <NUM_LIT:3> , len ( game . current_player . minions ) ) <EOL> self . assertEqual ( <NUM_LIT:7> , game . current_player . minions [ <NUM_LIT:0> ] . health ) <EOL> self . assertEqual ( <NUM_LIT:7> , game . current_player . minions [ <NUM_LIT:1> ] . health ) <EOL> self . assertEqual ( <NUM_LIT:7> , game . current_player . minions [ <NUM_LIT:2> ] . health ) <EOL> game . play_single_turn ( ) <EOL> self . assertEqual ( <NUM_LIT:3> , len ( game . other_player . minions ) ) <EOL> self . assertEqual ( <NUM_LIT:3> , game . other_player . minions [ <NUM_LIT:0> ] . health ) <EOL> self . assertEqual ( <NUM_LIT:3> , game . other_player . minions [ <NUM_LIT:1> ] . health ) <EOL> self . assertEqual ( <NUM_LIT:3> , game . other_player . minions [ <NUM_LIT:2> ] . health ) <EOL> def test_Pyroblast ( self ) : <EOL> game = generate_game_for ( Pyroblast , StonetuskBoar , CardTestingAgent , DoNothingAgent ) <EOL> for turn in range ( <NUM_LIT:0> , <NUM_LIT> ) : <EOL> game . play_single_turn ( ) <EOL> self . assertEqual ( <NUM_LIT:30> , game . current_player . hero . health ) <EOL> game . play_single_turn ( ) <EOL> self . assertEqual ( <NUM_LIT:20> , game . other_player . hero . health ) <EOL> def test_ArchmageAntonidas ( self ) : <EOL> game = generate_game_for ( [ ArchmageAntonidas , Vaporize ] , StonetuskBoar , CardTestingAgent , DoNothingAgent ) <EOL> for turn in range ( <NUM_LIT:0> , <NUM_LIT:12> ) : <EOL> game . play_single_turn ( ) <EOL> game . play_single_turn ( ) <EOL> self . assertEqual ( <NUM_LIT:1> , len ( game . current_player . minions ) ) <EOL> self . assertEqual ( "<STR_LIT>" , game . current_player . minions [ <NUM_LIT:0> ] . card . name ) <EOL> game . play_single_turn ( ) <EOL> game . play_single_turn ( ) <EOL> self . assertEqual ( "<STR_LIT>" , game . current_player . hand [ <NUM_LIT:9> ] . name ) <EOL> def test_Duplicate ( self ) : <EOL> game = generate_game_for ( [ BloodfenRaptor , Duplicate ] , ShadowBolt , OneCardPlayingAgent , CardTestingAgent ) <EOL> for turn in range ( <NUM_LIT:0> , <NUM_LIT:6> ) : <EOL> game . play_single_turn ( ) <EOL> self . assertEqual ( <NUM_LIT:6> , len ( game . other_player . hand ) ) <EOL> self . assertEqual ( "<STR_LIT>" , game . other_player . hand [ <NUM_LIT:4> ] . name ) <EOL> self . assertEqual ( "<STR_LIT>" , game . other_player . hand [ <NUM_LIT:5> ] . name ) <EOL> self . assertEqual ( <NUM_LIT:0> , len ( game . other_player . secrets ) ) <EOL> def test_Duplicate_and_play_after ( self ) : <EOL> game = generate_game_for ( [ Wisp , Wisp , Wisp , Wisp , Wisp , Duplicate ] , LightningStorm , <EOL> CardTestingAgent , OneCardPlayingAgent ) <EOL> for turn in range ( <NUM_LIT:5> ) : <EOL> game . play_single_turn ( ) <EOL> self . assertEqual ( <NUM_LIT:0> , len ( game . current_player . hand ) ) <EOL> self . assertEqual ( <NUM_LIT:5> , len ( game . current_player . minions ) ) <EOL> self . assertEqual ( <NUM_LIT:1> , len ( game . current_player . secrets ) ) <EOL> game . play_single_turn ( ) <EOL> self . assertEqual ( <NUM_LIT:0> , len ( game . other_player . secrets ) ) <EOL> self . assertEqual ( <NUM_LIT:0> , len ( game . other_player . minions ) ) <EOL> self . assertEqual ( <NUM_LIT:2> , len ( game . other_player . hand ) ) <EOL> game . play_single_turn ( ) <EOL> self . assertEqual ( <NUM_LIT:0> , len ( game . current_player . hand ) ) <EOL> self . assertEqual ( <NUM_LIT:3> , len ( game . current_player . minions ) ) <EOL> def test_Duplicate_MadScientist ( self ) : <EOL> game = generate_game_for ( Hellfire , [ MadScientist , MagmaRager , Duplicate ] , <EOL> OneCardPlayingAgent , OneCardPlayingAgent ) <EOL> for turn in range ( <NUM_LIT:6> ) : <EOL> game . play_single_turn ( ) <EOL> self . assertEqual ( <NUM_LIT:2> , len ( game . current_player . minions ) ) <EOL> self . assertEqual ( <NUM_LIT:0> , len ( game . current_player . secrets ) ) <EOL> game . play_single_turn ( ) <EOL> self . assertEqual ( <NUM_LIT:0> , len ( game . other_player . minions ) ) <EOL> self . assertEqual ( <NUM_LIT:0> , len ( game . other_player . secrets ) ) <EOL> self . assertEqual ( "<STR_LIT>" , game . other_player . hand [ - <NUM_LIT:1> ] . name ) <EOL> self . assertEqual ( "<STR_LIT>" , game . other_player . hand [ - <NUM_LIT:2> ] . name ) <EOL> def test_Snowchugger ( self ) : <EOL> game = generate_game_for ( Snowchugger , StonetuskBoar , PredictableAgent , DoNothingAgent ) <EOL> for turn in range ( <NUM_LIT:0> , <NUM_LIT:7> ) : <EOL> game . play_single_turn ( ) <EOL> self . assertEqual ( <NUM_LIT> , game . other_player . hero . health ) <EOL> self . assertFalse ( game . other_player . hero . frozen ) <EOL> self . assertEqual ( <NUM_LIT:1> , len ( game . current_player . minions ) ) <EOL> self . assertEqual ( <NUM_LIT:2> , game . current_player . minions [ <NUM_LIT:0> ] . calculate_attack ( ) ) <EOL> self . assertEqual ( <NUM_LIT:3> , game . current_player . minions [ <NUM_LIT:0> ] . health ) <EOL> self . assertEqual ( "<STR_LIT>" , game . current_player . minions [ <NUM_LIT:0> ] . card . name ) <EOL> game . play_single_turn ( ) <EOL> game . play_single_turn ( ) <EOL> self . assertEqual ( <NUM_LIT> , game . other_player . hero . health ) <EOL> self . assertTrue ( game . other_player . hero . frozen ) <EOL> random . seed ( <NUM_LIT> ) <EOL> game = generate_game_for ( Snowchugger , IronbarkProtector , OneCardPlayingAgent , PredictableAgent ) <EOL> for turn in range ( <NUM_LIT:0> , <NUM_LIT:4> ) : <EOL> game . play_single_turn ( ) <EOL> self . assertEqual ( <NUM_LIT:1> , len ( game . other_player . minions ) ) <EOL> self . assertEqual ( <NUM_LIT:2> , game . other_player . minions [ <NUM_LIT:0> ] . health ) <EOL> self . assertEqual ( <NUM_LIT> , game . current_player . hero . health ) <EOL> self . assertTrue ( game . current_player . hero . frozen ) <EOL> game . play_single_turn ( ) <EOL> game . play_single_turn ( ) <EOL> self . assertEqual ( <NUM_LIT> , game . current_player . hero . health ) <EOL> game = generate_game_for ( Snowchugger , StonetuskBoar , PredictableAgent , PredictableAgent ) <EOL> for turn in range ( <NUM_LIT:0> , <NUM_LIT:2> ) : <EOL> game . play_single_turn ( ) <EOL> self . assertEqual ( <NUM_LIT:1> , len ( game . players [ <NUM_LIT:1> ] . minions ) ) <EOL> self . assertEqual ( "<STR_LIT>" , game . players [ <NUM_LIT:1> ] . minions [ <NUM_LIT:0> ] . card . name ) <EOL> game . players [ <NUM_LIT:1> ] . minions [ <NUM_LIT:0> ] . base_attack = <NUM_LIT:0> <EOL> self . assertEqual ( <NUM_LIT:0> , game . players [ <NUM_LIT:1> ] . minions [ <NUM_LIT:0> ] . calculate_attack ( ) ) <EOL> self . assertEqual ( <NUM_LIT:3> , game . players [ <NUM_LIT:1> ] . minions [ <NUM_LIT:0> ] . health ) <EOL> game . play_single_turn ( ) <EOL> self . assertEqual ( <NUM_LIT:1> , game . players [ <NUM_LIT:1> ] . minions [ <NUM_LIT:0> ] . health ) <EOL> self . assertFalse ( game . players [ <NUM_LIT:0> ] . minions [ <NUM_LIT:0> ] . frozen ) <EOL> def test_GoblinBlastmage ( self ) : <EOL> game = generate_game_for ( [ GoblinBlastmage , ClockworkGnome , GoblinBlastmage ] , [ Mechwarper , ClockworkGnome ] , <EOL> CardTestingAgent , CardTestingAgent ) <EOL> for turn in range ( <NUM_LIT:6> ) : <EOL> game . play_single_turn ( ) <EOL> self . assertEqual ( <NUM_LIT:0> , len ( game . other_player . minions ) ) <EOL> self . assertEqual ( <NUM_LIT:7> , len ( game . current_player . minions ) ) <EOL> self . assertEqual ( <NUM_LIT:3> , game . current_player . minions [ <NUM_LIT:0> ] . health ) <EOL> self . assertEqual ( <NUM_LIT:1> , game . current_player . minions [ <NUM_LIT:1> ] . health ) <EOL> self . assertEqual ( <NUM_LIT:3> , game . current_player . minions [ <NUM_LIT:2> ] . health ) <EOL> self . assertEqual ( <NUM_LIT:1> , game . current_player . minions [ <NUM_LIT:3> ] . health ) <EOL> self . assertEqual ( <NUM_LIT:3> , game . current_player . minions [ <NUM_LIT:4> ] . health ) <EOL> self . assertEqual ( <NUM_LIT:1> , game . current_player . minions [ <NUM_LIT:5> ] . health ) <EOL> self . assertEqual ( <NUM_LIT:3> , game . current_player . minions [ <NUM_LIT:6> ] . health ) <EOL> game . play_single_turn ( ) <EOL> self . assertEqual ( <NUM_LIT:1> , len ( game . current_player . minions ) ) <EOL> self . assertEqual ( <NUM_LIT:7> , len ( game . other_player . minions ) ) <EOL> self . assertEqual ( <NUM_LIT:3> , game . other_player . minions [ <NUM_LIT:0> ] . health ) <EOL> self . assertEqual ( <NUM_LIT:1> , game . other_player . minions [ <NUM_LIT:1> ] . health ) <EOL> self . assertEqual ( <NUM_LIT:3> , game . other_player . minions [ <NUM_LIT:2> ] . health ) <EOL> self . assertEqual ( <NUM_LIT:1> , game . other_player . minions [ <NUM_LIT:3> ] . health ) <EOL> self . assertEqual ( <NUM_LIT:3> , game . other_player . minions [ <NUM_LIT:4> ] . health ) <EOL> self . assertEqual ( <NUM_LIT:1> , game . other_player . minions [ <NUM_LIT:5> ] . health ) <EOL> self . assertEqual ( <NUM_LIT:3> , game . other_player . minions [ <NUM_LIT:6> ] . health ) <EOL> self . assertEqual ( <NUM_LIT:30> , game . other_player . hero . health ) <EOL> game . play_single_turn ( ) <EOL> game . play_single_turn ( ) <EOL> self . assertEqual ( <NUM_LIT:3> , len ( game . current_player . minions ) ) <EOL> self . assertEqual ( <NUM_LIT:5> , len ( game . other_player . minions ) ) <EOL> self . assertEqual ( <NUM_LIT:3> , game . other_player . minions [ <NUM_LIT:0> ] . health ) <EOL> self . assertEqual ( <NUM_LIT:1> , game . other_player . minions [ <NUM_LIT:1> ] . health ) <EOL> self . assertEqual ( <NUM_LIT:1> , game . other_player . minions [ <NUM_LIT:2> ] . health ) <EOL> self . assertEqual ( <NUM_LIT:3> , game . other_player . minions [ <NUM_LIT:3> ] . health ) <EOL> self . assertEqual ( <NUM_LIT:3> , game . other_player . minions [ <NUM_LIT:4> ] . health ) <EOL> self . assertEqual ( <NUM_LIT:30> , game . other_player . hero . health ) <EOL> def test_Flamecannon ( self ) : <EOL> game = generate_game_for ( Flamecannon , SenjinShieldmasta , OneCardPlayingAgent , OneCardPlayingAgent ) <EOL> for turn in range ( <NUM_LIT:0> , <NUM_LIT:8> ) : <EOL> game . play_single_turn ( ) <EOL> self . assertEqual ( <NUM_LIT:7> , len ( game . players [ <NUM_LIT:0> ] . hand ) ) <EOL> self . assertEqual ( <NUM_LIT:1> , len ( game . players [ <NUM_LIT:1> ] . minions ) ) <EOL> self . assertEqual ( <NUM_LIT:5> , game . players [ <NUM_LIT:1> ] . minions [ <NUM_LIT:0> ] . health ) <EOL> game . play_single_turn ( ) <EOL> self . assertEqual ( <NUM_LIT:7> , len ( game . players [ <NUM_LIT:0> ] . hand ) ) <EOL> self . assertEqual ( <NUM_LIT:1> , len ( game . players [ <NUM_LIT:1> ] . minions ) ) <EOL> self . assertEqual ( <NUM_LIT:1> , game . players [ <NUM_LIT:1> ] . minions [ <NUM_LIT:0> ] . health ) <EOL> def test_WeeSpellstopper ( self ) : <EOL> game = generate_game_for ( WeeSpellstopper , ShadowBolt , OneCardPlayingAgent , OneCardPlayingAgent ) <EOL> for turn in range ( <NUM_LIT:0> , <NUM_LIT:8> ) : <EOL> game . play_single_turn ( ) <EOL> self . assertEqual ( <NUM_LIT:1> , len ( game . players [ <NUM_LIT:0> ] . minions ) ) <EOL> self . assertEqual ( <NUM_LIT:1> , game . players [ <NUM_LIT:0> ] . minions [ <NUM_LIT:0> ] . health ) <EOL> game . play_single_turn ( ) <EOL> game . play_single_turn ( ) <EOL> self . assertEqual ( <NUM_LIT:2> , len ( game . players [ <NUM_LIT:0> ] . minions ) ) <EOL> self . assertEqual ( <NUM_LIT:5> , game . players [ <NUM_LIT:0> ] . minions [ <NUM_LIT:0> ] . health ) <EOL> self . assertEqual ( <NUM_LIT:1> , game . players [ <NUM_LIT:0> ] . minions [ <NUM_LIT:1> ] . health ) <EOL> game . play_single_turn ( ) <EOL> game . players [ <NUM_LIT:0> ] . minions [ <NUM_LIT:0> ] . die ( None ) <EOL> game . players [ <NUM_LIT:0> ] . minions [ <NUM_LIT:1> ] . die ( None ) <EOL> game . check_delayed ( ) <EOL> self . assertEqual ( <NUM_LIT:1> , len ( game . players [ <NUM_LIT:0> ] . minions ) ) <EOL> self . assertEqual ( <NUM_LIT:1> , game . players [ <NUM_LIT:0> ] . minions [ <NUM_LIT:0> ] . health ) <EOL> game . play_single_turn ( ) <EOL> self . assertEqual ( <NUM_LIT:0> , len ( game . players [ <NUM_LIT:0> ] . minions ) ) <EOL> def test_WeeSpellstopperSilence ( self ) : <EOL> game = generate_game_for ( WeeSpellstopper , [ Silence , ShadowBolt ] , OneCardPlayingAgent , <EOL> OneCardPlayingAgent ) <EOL> for turn in range ( <NUM_LIT:0> , <NUM_LIT:8> ) : <EOL> game . play_single_turn ( ) <EOL> self . assertEqual ( <NUM_LIT:1> , len ( game . players [ <NUM_LIT:0> ] . minions ) ) <EOL> self . assertEqual ( <NUM_LIT:5> , game . players [ <NUM_LIT:0> ] . minions [ <NUM_LIT:0> ] . health ) <EOL> game . play_single_turn ( ) <EOL> game . play_single_turn ( ) <EOL> self . assertEqual ( <NUM_LIT:2> , len ( game . players [ <NUM_LIT:0> ] . minions ) ) <EOL> self . assertEqual ( <NUM_LIT:1> , game . players [ <NUM_LIT:0> ] . minions [ <NUM_LIT:0> ] . health ) <EOL> self . assertEqual ( <NUM_LIT:5> , game . players [ <NUM_LIT:0> ] . minions [ <NUM_LIT:1> ] . health ) <EOL> def test_FlameLeviathan ( self ) : <EOL> game = generate_game_for ( Wisp , FlameLeviathan , CardTestingAgent , CardTestingAgent ) <EOL> game . play_single_turn ( ) <EOL> self . assertEqual ( <NUM_LIT:4> , len ( game . current_player . minions ) ) <EOL> self . assertEqual ( <NUM_LIT:30> , game . current_player . hero . health ) <EOL> self . assertEqual ( <NUM_LIT:30> , game . other_player . hero . health ) <EOL> game . play_single_turn ( ) <EOL> self . assertEqual ( <NUM_LIT:0> , len ( game . other_player . minions ) ) <EOL> self . assertEqual ( <NUM_LIT> , game . current_player . hero . health ) <EOL> self . assertEqual ( <NUM_LIT> , game . other_player . hero . health ) <EOL> def test_EchoOfMedivh ( self ) : <EOL> game = generate_game_for ( [ NoviceEngineer , NoviceEngineer , GnomishInventor , GnomishInventor , EchoOfMedivh ] , Wisp , <EOL> OneCardPlayingAgent , DoNothingAgent ) <EOL> for turn in range ( <NUM_LIT:0> , <NUM_LIT:10> ) : <EOL> game . play_single_turn ( ) <EOL> self . assertEqual ( <NUM_LIT:8> , len ( game . players [ <NUM_LIT:0> ] . hand ) ) <EOL> self . assertEqual ( <NUM_LIT:4> , len ( game . players [ <NUM_LIT:0> ] . minions ) ) <EOL> game . play_single_turn ( ) <EOL> self . assertEqual ( <NUM_LIT:10> , len ( game . players [ <NUM_LIT:0> ] . hand ) ) <EOL> self . assertEqual ( <NUM_LIT:4> , len ( game . players [ <NUM_LIT:0> ] . minions ) ) <EOL> self . assertEqual ( "<STR_LIT>" , game . players [ <NUM_LIT:0> ] . hand [ <NUM_LIT:8> ] . name ) <EOL> self . assertEqual ( "<STR_LIT>" , game . players [ <NUM_LIT:0> ] . hand [ <NUM_LIT:9> ] . name ) <EOL> def test_UnstablePortal ( self ) : <EOL> game = generate_game_for ( UnstablePortal , StonetuskBoar , CardTestingAgent , DoNothingAgent ) <EOL> for turn in range ( <NUM_LIT:3> ) : <EOL> game . play_single_turn ( ) <EOL> self . assertEqual ( <NUM_LIT:5> , len ( game . current_player . hand ) ) <EOL> self . assertTrue ( game . current_player . hand [ - <NUM_LIT:1> ] . is_minion ( ) ) <EOL> if game . current_player . hand [ - <NUM_LIT:1> ] . mana >= <NUM_LIT:3> : <EOL> self . assertEqual ( <NUM_LIT:3> , game . current_player . hand [ - <NUM_LIT:1> ] . mana - game . current_player . hand [ - <NUM_LIT:1> ] . mana_cost ( ) ) <EOL> def test_DragonsBreath ( self ) : <EOL> game = generate_game_for ( [ Flamestrike , DragonsBreath ] , StonetuskBoar , CardTestingAgent , OneCardPlayingAgent ) <EOL> for turn in range ( <NUM_LIT> ) : <EOL> game . play_single_turn ( ) <EOL> self . assertEqual ( <NUM_LIT:0> , len ( game . other_player . minions ) ) <EOL> self . assertEqual ( <NUM_LIT> , game . other_player . hero . health ) <EOL> game . play_single_turn ( ) <EOL> game . play_single_turn ( ) <EOL> self . assertEqual ( <NUM_LIT:0> , len ( game . other_player . minions ) ) <EOL> self . assertEqual ( <NUM_LIT> , game . other_player . hero . health ) <EOL> def test_Flamewaker ( self ) : <EOL> game = generate_game_for ( [ Flamewaker , CircleOfHealing ] , CircleOfHealing , <EOL> OneCardPlayingAgent , OneCardPlayingAgent ) <EOL> for turn in range ( <NUM_LIT:6> ) : <EOL> game . play_single_turn ( ) <EOL> self . assertEqual ( <NUM_LIT:1> , len ( game . players [ <NUM_LIT:0> ] . minions ) ) <EOL> self . assertEqual ( <NUM_LIT:30> , game . players [ <NUM_LIT:0> ] . hero . health ) <EOL> self . assertEqual ( <NUM_LIT:30> , game . players [ <NUM_LIT:1> ] . hero . health ) <EOL> game . play_single_turn ( ) <EOL> self . assertEqual ( <NUM_LIT:1> , len ( game . players [ <NUM_LIT:0> ] . minions ) ) <EOL> self . assertEqual ( <NUM_LIT:30> , game . players [ <NUM_LIT:0> ] . hero . health ) <EOL> self . assertEqual ( <NUM_LIT> , game . players [ <NUM_LIT:1> ] . hero . health ) <EOL> def test_ArcaneBlast ( self ) : <EOL> game = generate_game_for ( [ KoboldGeomancer , DalaranMage , OgreMagi , ArcaneBlast ] , TournamentMedic , <EOL> OneCardPlayingAgent , OneCardPlayingAgent ) <EOL> for turn in range ( <NUM_LIT:8> ) : <EOL> game . play_single_turn ( ) <EOL> self . assertEqual ( <NUM_LIT:3> , len ( game . other_player . minions ) ) <EOL> self . assertEqual ( <NUM_LIT:1> , len ( game . current_player . minions ) ) <EOL> game . play_single_turn ( ) <EOL> self . assertEqual ( <NUM_LIT:0> , len ( game . other_player . minions ) ) <EOL> self . assertEqual ( <NUM_LIT:3> , len ( game . current_player . minions ) ) </s>
