Exemple #1
0
 def testAllUniqueCards(self):
     d = game.Deck()
     ids = []
     for x in d.cards:
         for y in ids:
             self.assertNotEqual(x.card_id, y)
         ids.append(x.card_id)
Exemple #2
0
    def test_hit_or_stand_player_stands(self):
        test_deck = game.Deck()
        test_hand = game.Hand()
        test_selection = 's'

        game.hit_or_stand(test_deck, test_hand, test_selection)

        self.assertEqual(game.playing, False)
Exemple #3
0
    def test_hit_or_stand_player_hit(self):
        test_deck = game.Deck()
        test_hand = game.Hand()
        test_selection = 'h'

        game.hit_or_stand(test_deck, test_hand, test_selection)

        self.assertEqual(len(test_hand.cards), 1)
Exemple #4
0
    def test_deal_to_player(self):
        test_deck = game.Deck()
        test_deck.shuffle()

        test_player = game.Hand()
        pulled_card = test_deck.deal()
        test_player.add_card(pulled_card)

        self.assertIsNotNone(test_player.value)
        self.assertEqual(test_player.cards[0].suit, pulled_card.suit)
Exemple #5
0
 def setUp(self):
     '''
     2 of Hearts is the top card in deck
     after building the deck
     '''
     self.player = game.Player("Bob")
     self.pile = game.Pile()
     self.deck = game.Deck()
     # Drew 2 of Hearts (top card)
     self.player.draw(self.deck, self.pile)
Exemple #6
0
 def test_deck_creation(self):
     test_deck = game.Deck()
     self.assertEqual(len(test_deck.deck), 52)
Exemple #7
0
    def test_hit_card(self):
        test_deck = game.Deck()
        test_hand = game.Hand()
        game.hit(test_deck, test_hand)

        self.assertEqual(len(test_hand.cards), 1)
Exemple #8
0
 def setUp(self):
     self.deck = game.Deck()
Exemple #9
0
 def test_init(self):
     deck = game.Deck()
     assert len(deck.trap_quantities) == game.NTRAPTYPES
     for trap_q in deck.trap_quantities:
         assert trap_q == game.NTRAPS
Exemple #10
0
 def test_start_round(self):
     deck = game.Deck()
     deck.start_round()
     assert len(deck.cards) == 31
Exemple #11
0
 def testDeckGetCard(self):
     d = game.Deck()
     card = d.drawCard()
     for x in d.cards:
         self.assertNotEqual(card.card_id, x.card_id)