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)
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)
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)
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)
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)
def test_deck_creation(self): test_deck = game.Deck() self.assertEqual(len(test_deck.deck), 52)
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)
def setUp(self): self.deck = game.Deck()
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
def test_start_round(self): deck = game.Deck() deck.start_round() assert len(deck.cards) == 31
def testDeckGetCard(self): d = game.Deck() card = d.drawCard() for x in d.cards: self.assertNotEqual(card.card_id, x.card_id)