def setUp(self): """ Build the Player and Phase List for the test """ self.match1 = NumberSet(1) self.match2 = NumberSet(1) self.phase1 = Phase([self.match1, self.match2]) self.phase2 = Phase([]) self.phaseList = PhaseList([self.phase1, self.phase2]) self.player = Player("", self.phaseList)
def setUp(self): """ Build the Round and Players for the test """ self.player1 = Player("", StandardPhaseList) self.player2 = Player("", StandardPhaseList) self.round = Round([self.player1, self.player2]) self.player1 = self.round.players[0] self.player2 = self.round.players[1]
class completePhase(unittest.TestCase): """ Test cases of completePhase """ def setUp(self): """ Build the Player and Phase List for the test """ self.match1 = NumberSet(1) self.match2 = NumberSet(1) self.phase1 = Phase([self.match1, self.match2]) self.phase2 = Phase([]) self.phaseList = PhaseList([self.phase1, self.phase2]) self.player = Player("", self.phaseList) def nextPhase(self): """ Test that the player is now on the next phase """ self.player.completePhase() assert self.player.phase == self.phase2, "Player should now be on the next phase"
def setUp(self): """ Build the Player Round Wrapper for the test """ self.match1 = NumberSet(1) self.match2 = NumberSet(1) self.phase1 = Phase([self.match1, self.match2]) self.phase2 = Phase([]) self.phaseList = PhaseList([self.phase1, self.phase2]) self.player = Player("", self.phaseList) self.matchPileManager = MatchPileManager() self.hand = [NumberCard(1, None), NumberCard(2, None)] self.playerRoundWrapper = PlayerRoundWrapper(self.player, self.hand, self.matchPileManager)
def __init__(self, numberOfPlayers, names, phaseList=StandardPhaseList): """ Initialize the game """ self.players = [] for i in range(numberOfPlayers): self.players.append(Player(names[i], phaseList))