def test_score_pegging_stack_no_score(self): stack = [] sc, desc = score.score_pegging_stack(stack) self.assertEqual(0, sc) stack = Card.from_str_list('AC') sc, desc = score.score_pegging_stack(stack) self.assertEqual(0, sc) stack = Card.from_str_list('AC, 2S, 5D') sc, desc = score.score_pegging_stack(stack) self.assertEqual(0, sc) stack = Card.from_str_list('AC, 2S, AD') sc, desc = score.score_pegging_stack(stack) self.assertEqual(0, sc)
def test_score_pegging_stack_run_of_7(self): stack = Card.from_str_list('AD, 2D, 3S, 4H, 5H, 6H, 7C') sc, desc = score.score_pegging_stack(stack) self.assertEqual(7, sc)
def test_score_pegging_stack_run_of_4(self): stack = Card.from_str_list('2D, 3S, 4H, 5H') sc, desc = score.score_pegging_stack(stack) self.assertEqual(4, sc)
def test_score_pegging_stack_run_of_3(self): stack = Card.from_str_list('AC, JS, 2D, 3S, 4H') sc, desc = score.score_pegging_stack(stack) self.assertEqual(3, sc)
def test_score_pegging_stack_4_of_a_kind(self): stack = Card.from_str_list('AC, 2S, 2D, 2S, 2H') sc, desc = score.score_pegging_stack(stack) self.assertEqual(12, sc)
def score_pegging_stack(stack): return score.score_pegging_stack(stack)