def test_get_score(): assert get_score([5, 5, 5, 5, 5], range(5)) == (0, 5000) assert get_score(range(2, 7), range(5)) == (0, 1500) assert get_score([2, 6, 3, 3, 3], range(2, 5)) == (2, 300) assert get_score([5, 1, 3, 3, 3], range(5)) == (0, 450) assert get_score([5, 6, 3, 3, 3], [0, 2, 3, 4]) == (1, 350) assert get_score([1], [0]) == (0, 100) assert get_score([1, 3, 3, 3], range(4)) == (0, 400)
def test_one_ace_11_and_one_1(self): self.bob.add_card(Card('9', 'hearts')) self.bob.add_card(Card('A', 'clubs')) self.bob.add_card(Card('A', 'clubs')) self.assertEqual(21, game.get_score(self.bob))
def test_ace_score_over_21(self): self.bob.add_card(Card('10', 'hearts')) self.bob.add_card(Card('10', 'diamonds')) self.bob.add_card(Card('A', 'clubs')) self.bob.add_card(Card('A', 'clubs')) self.assertEqual(22, game.get_score(self.bob))
def test_other_score_determination(self): self.bob.add_card(Card('4', 'hearts')) self.bob.add_card(Card('7', 'diamonds')) self.bob.add_card(Card('A', 'clubs')) self.assertEqual(12, game.get_score(self.bob))
def test_blackjack_score_determination(self): self.bob.add_card(Card('10', 'hearts')) self.bob.add_card(Card('A', 'diamonds')) self.assertEqual(21, game.get_score(self.bob))
def test_basic_score_determination(self): self.bob.add_card(Card('5', 'hearts')) self.bob.add_card(Card('A', 'diamonds')) self.assertEqual(16, game.get_score(self.bob))
from game import get_score from game import alive score = get_score() print(score)