def test_player_pc_turn(self): """ Tests the player_pc_turn method. """ deck_game = Game() deck_game.aggressive = True deck_game.set_up_game() pc_ds = deck_game.player_pc.deck.size() deck_game.player_pc_turn() self.assertEqual(deck_game.player_pc.deck.size(), pc_ds - 5)
def test_best_buy_acquisative(self): """ Tests the computer_best_buy method for an acquisative opponent. The index returned should abide by the implemented logic. """ deck_game = Game() deck_game.aggressive = False temp_list = [("S", Card('Archer', 3, 1, 5)), (1, Card('Test1', 1, 3, 3)), (3, Card('Test2', 0, 3, 2))] deck_game.computer_best_buy(temp_list) self.assertEqual(deck_game.computer_best_buy(temp_list), 2)
def test_computer_buy(self): """ Tests the computer_buy method. """ deck_game = Game() deck_game.aggressive = True deck_game.player_pc._money = 3 deck_game.central['active'].push(Card('Archer', 2, 2, 3)) deck_game.central['active'].push(Card('Test1', 3, 1, 3)) deck_game.central['active'].push(Card('Test2', 0, 4, 3)) deck_game.central['supplement'].push(Card('Archer', 3, 3, 6)) deck_game.computer_buy() self.assertEqual(deck_game.player_pc.discard.cards[0].name, 'Test1')