示例#1
0
 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)
示例#2
0
 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')
     ]))
示例#3
0
 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')
     ]))
示例#4
0
 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')
     ]))
示例#5
0
 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')
     ]))