def test__setUpVictoryCards(self): victoryCards = 10 self.mocker.StubOutWithMock(dominion_rules, 'getGameSetupVictoryCardCount') self.mocker.StubOutWithMock(Game, '_makePile') self.mocker.StubOutWithMock(Game, '_combinePiles') dominion_rules.getGameSetupVictoryCardCount(0).AndReturn(victoryCards) Game._makePile(dominion_data.cards['estate'], victoryCards).AndReturn("estate pile") Game._makePile(dominion_data.cards['duchy'], victoryCards).AndReturn("duchy pile") Game._makePile(dominion_data.cards['province'], victoryCards).AndReturn("province pile") Game._makePile(dominion_data.cards['estate'], 0).AndReturn("additional estates") Game._combinePiles(["estate pile","additional estates"]).AndReturn("updated estate pile") self.mocker.ReplayAll() game = Game() game._setUpVictoryCards() self.assertEqual(game.SupplyArea.EstatePile, "updated estate pile") self.assertEqual(game.SupplyArea.DuchyPile, "duchy pile") self.assertEqual(game.SupplyArea.ProvincePile, "province pile") self.mocker.VerifyAll()
def test__drawFirstHands(self): game = Game() game.addPlayer(Player(name="Player 1")) game.addPlayer(Player(name="Player 2")) estatePile = game._makePile(dominion_data.cards['estate'], dominion_rules.FIRST_DECK.ESTATE_CARDS) copperPile = game._makePile(dominion_data.cards['copper'], dominion_rules.FIRST_DECK.COPPER_CARDS) for player in game.Players: firstDeck = game._combinePiles([estatePile, copperPile]) player.DrawPile = firstDeck game._drawFirstHands() for player in game.Players: self.assertEqual(player.DrawPile.len(), 5) self.assertEqual(player.Hand.len(), 5)