def test_is_straight_flush(self): label_patterns = [ True, False, False, False, False, False, False, False, False, True, False ] for hands, label in zip(self.hands_patterns, label_patterns): with self.subTest(hands=hands, label=label): self.assertEqual(poker.is_straight_flush(hands), label)
def test_straight_flush_false_neither(self): self.assertFalse(is_straight_flush([ Card('2', 'D'), Card('3', 'S'), Card('A', 'D'), Card('K', 'D'), Card('6', 'D') ]))
def test_straight_flush_false_only_straight(self): self.assertFalse(is_straight_flush([ Card('T', 'S'), Card('J', 'D'), Card('Q', 'D'), Card('K', 'D'), Card('A', 'D') ]))
def test_straight_flush_false_only_flush(self): self.assertFalse(is_straight_flush([ Card('T', 'D'), Card('3', 'D'), Card('2', 'D'), Card('6', 'D'), Card('A', 'D') ]))
def test_straight_flush_true(self): self.assertTrue(is_straight_flush([ Card('T', 'D'), Card('J', 'D'), Card('Q', 'D'), Card('K', 'D'), Card('A', 'D') ]))