Esempio n. 1
0
 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."
Esempio n. 2
0
 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."
Esempio n. 3
0
 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."
Esempio n. 4
0
 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."
Esempio n. 5
0
    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
Esempio n. 6
0
 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."
Esempio n. 7
0
 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."