def test_setUpGame(self): self.mocker.StubOutWithMock(Game, '_setUpTreasureCards') Game._setUpTreasureCards() self.mocker.StubOutWithMock(Game, '_setUpVictoryCards') Game._setUpVictoryCards() self.mocker.StubOutWithMock(Game, '_setUpCurseCards') Game._setUpCurseCards() self.mocker.StubOutWithMock(Game, '_setUpKingdomCards') Game._setUpKingdomCards() self.mocker.StubOutWithMock(Game, '_setUpInitialDecks') Game._setUpInitialDecks() self.mocker.StubOutWithMock(Game, '_drawFirstHands') Game._drawFirstHands() self.mocker.ReplayAll() game = Game() game.setUpGame() self.mocker.VerifyAll()
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()