예제 #1
0
 def test_is_flush(self):
     label_patterns = [
         True, False, True, 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_flush(hands), label)
예제 #2
0
 def test_flush_false(self):
     self.assertFalse(is_flush([
         Card('T', 'S'), Card('3', 'D'),
         Card('2', 'D'), Card('6', 'D'),
         Card('A', 'D')
     ]))
예제 #3
0
 def test_flush_true(self):
     self.assertTrue(is_flush([
         Card('T', 'D'), Card('3', 'D'),
         Card('2', 'D'), Card('6', 'D'),
         Card('A', 'D')
     ]))
예제 #4
0
 def test_is_flush(self):
     hand = ["2C", "8C", "4C", "TC", "6C"]
     self.assertTrue(is_flush(hand))