def test_hand_value_2(self): hand = cards.CardHand() hand.add(cards.Card('K', 'D')) hand.add(cards.Card('A', 'D')) actual = hand.score() expected = 21 self.assertEqual(actual, expected)
def test_hand_value_1(self): hand = cards.CardHand() hand.add(cards.Card('1', 'D')) hand.add(cards.Card('2', 'D')) actual = hand.score() expected = 3 self.assertEqual(actual, expected)
def test_dealer_1(self): d = players.Dealer() d.curr_hand.add(cards.Card('A', 'S')) d.curr_hand.add(cards.Card('10', 'S')) d.curr_hand.cards[0].is_visible = False expected = 21 actual = d.curr_hand.score() self.assertEqual(expected, actual)
def test_dealer_3(self): d = players.Dealer() d.curr_hand.add(cards.Card('A', 'S')) d.curr_hand.add(cards.Card('5', 'S')) d.curr_hand.cards[0].is_visible = False expected = True actual = d.should_hit() self.assertEqual(expected, actual)