def make_dealer_move(self): if len(self.cards) == 0: return if Rulebook.check_dealer_hit(Rulebook.check_hand_value(self.cards)): self.cards.append(self.deck.draw_card()) if Rulebook.check_bust(Rulebook.check_hand_value(self.cards)): self.end_hand() return self.update_view() self.make_dealer_move()
def test_cdh_dealer_not_hit_ace(self): self.assertFalse(Rulebook.check_dealer_hit("10 or 20"))
def test_cdh_dealer_not_hit(self): self.assertFalse(Rulebook.check_dealer_hit("17"))
def test_cdh_dealer_hit_ace(self): self.assertTrue(Rulebook.check_dealer_hit("3 or 13"))
def test_cdh_dealer_hit(self): self.assertTrue(Rulebook.check_dealer_hit("15"))