def wildAtEnd(self): """ Test that a wild can match at the end """ assert self.run.matched([ self.getNumberCard(1), self.getNumberCard(2), WildCard() ]), "Assert there is a match when a wild is used at the end."
def wildInMiddle(self): """ Test that a wild can match in the middle """ assert self.run.matched([ self.getNumberCard(1), WildCard(), self.getNumberCard(3) ]), "Assert there is a match when a wild is used in the middle."
def wildAtBeginning(self): """ Test that a wild can match at the beginning """ assert self.run.matched([ WildCard(), self.getNumberCard(2), self.getNumberCard(3) ]), "Assert there is a match when a wild is used at the beginning."
def wildReplaced(self): """ Test that replacing a wild cannot match """ wildCard = WildCard() assert self.run.matched([ self.getNumberCard(1), self.getNumberCard(2), wildCard ]), "Assert there is a match when a wild is used at the end." assert self.run.matched([ self.getNumberCard(1), self.getNumberCard(2), self.getNumberCard(3), wildCard ]), "Assert there is a match when a wild is replaced."
def buildDeckInitializer(self): """ Build the Deck Initializer """ deckInitializer = DeckInitializer() for i in range(1, 13): for color in colors: card = NumberCard(i, color) deckInitializer.addSameItem(card, 2) deckInitializer.addSameItem(WildCard(), 8) deckInitializer.addSameItem(SkipCard(), 4) return deckInitializer
def wildReplacedStored(self): """ Test that replacing a wild cannot match when the value is stored """ wildCard = WildCard() assert self.run.matched( [self.getNumberCard(1), self.getNumberCard(2), wildCard], store=True ), "Assert there is a match when a wild is used at the end." assert not self.run.matched( [ self.getNumberCard(1), self.getNumberCard(2), self.getNumberCard(3), wildCard ] ), "Assert there is no match when a wild is replaced and the value stored."
def handleWildCard(self): """ Test that a wild card can complete the match """ assert self.numberSet.matched( [self.getNumberCard(), self.getNumberCard(), WildCard()]), "Assert there is a match when a wild is used."