Example #1
0
 def test_gettype_royalflush_returnsROYALFLUSH(self):
     h = tools.make('royalflush')
     h = tools.make('royalflush')
     val = ev.get_value(h)
     expected = 'ROYAL FLUSH'
     result = ev.get_type(val)
     self.assertEqual(expected, result)
Example #2
0
 def test_findbesthand_pair_returnsPAIR(self):
     cards = tools.convert_to_cards(['2c', '3c', '5s', '7s', 'Kc', 'Ac', 'As'])
     besthand = evaluator.find_best_hand(cards)
     val = evaluator.get_value(besthand)
     expected = 'PAIR'
     result = evaluator.get_type(val)
     self.assertEqual(expected, result)
Example #3
0
 def test_findbesthand_straight_returnsSTRAIGHT(self):
     cards = tools.convert_to_cards(['Ac', 'As', '2c', '3s', '4h', '5s', '5h'])
     besthand = evaluator.find_best_hand(cards)
     val = evaluator.get_value(besthand)
     expected = 'STRAIGHT'
     result = evaluator.get_type(val)
     self.assertEqual(expected, result)
Example #4
0
 def test_findbesthand_flush_returnsFLUSH(self):
     cards = tools.convert_to_cards(['8s', '9s', 'Tc', 'Js', 'Qs', 'Ks', 'Ac'])
     besthand = evaluator.find_best_hand(cards)
     val = evaluator.get_value(besthand)
     expected = 'FLUSH'
     result = evaluator.get_type(val)
     self.assertEqual(expected, result)
Example #5
0
 def test_findbesthand_quads_returnsQUADS(self):
     cards = tools.convert_to_cards(['Kc', 'Kd', 'Ks', 'Ac', 'Kd', 'Ah', 'As'])
     besthand = evaluator.find_best_hand(cards)
     val = evaluator.get_value(besthand)
     expected = 'QUADS'
     result = evaluator.get_type(val)
     self.assertEqual(expected, result)
Example #6
0
 def test_findbesthand_straightflush_returnsSTRAIGHTFLUSH(self):
     cards = tools.convert_to_cards(['4s', '5s', '6s', '7s', '8s', 'Ks', 'As'])
     besthand = evaluator.find_best_hand(cards)
     val = evaluator.get_value(besthand)
     expected = 'STRAIGHT FLUSH'
     result = evaluator.get_type(val)
     self.assertEqual(expected, result)
Example #7
0
 def test_findbesthand_fullhouse_returnsFULLHOUSE(self):
     cards = tools.convert_to_cards(['7c', '7s', 'Ks', 'Kc', 'Ah', 'Ac', 'As'])
     besthand = evaluator.find_best_hand(cards)
     val = evaluator.get_value(besthand)
     expected = 'FULL HOUSE'
     result = evaluator.get_type(val)
     self.assertEqual(expected, result)
Example #8
0
 def test_gettype_pairlow_returnsPAIR(self):
     h = tools.make('pair_low')
     val = ev.get_value(h)
     expected = 'PAIR'
     result = ev.get_type(val)
     self.assertEqual(expected, result)
Example #9
0
 def test_gettype_twopairhigh_returnsTWOPAIR(self):
     h = tools.make('twopair_high')
     val = ev.get_value(h)
     expected = 'TWO PAIR'
     result = ev.get_type(val)
     self.assertEqual(expected, result)
Example #10
0
 def test_gettype_tripslow_returnsTRIPS(self):
     h = tools.make('trips_low')
     val = ev.get_value(h)
     expected = 'TRIPS'
     result = ev.get_type(val)
     self.assertEqual(expected, result)
Example #11
0
 def test_make_royalflush_returnsRoyalFlush(self):
     h = tools.make('royalflush')
     expected = 'ROYAL FLUSH'
     result = ev.get_type(ev.get_value(h))
     self.assertEqual(expected, result)
Example #12
0
 def test_gettype_straightlow_returnsSTRAIGHT(self):
     h = tools.make('straight_low')
     val = ev.get_value(h)
     expected = 'STRAIGHT'
     result = ev.get_type(val)
     self.assertEqual(expected, result)
Example #13
0
 def test_gettype_quadslow_returnsQUADS(self):
     h = tools.make('quads_low')
     val = ev.get_value(h)
     expected = 'QUADS'
     result = ev.get_type(val)
     self.assertEqual(expected, result)
Example #14
0
 def rank(self):
     return evaluator.get_type(self.value())
Example #15
0
 def test_gettype_OESD_returns(self):
     h = tools.make('OESD')
     val = ev.get_value(h)
     expected = 'HIGH CARD'
     result = ev.get_type(val)
     self.assertEqual(expected, result)
Example #16
0
 def test_gettype_fullhouselow_returnsFULLHOUSE(self):
     h = tools.make('fullhouse_low')
     val = ev.get_value(h)
     expected = 'FULL HOUSE'
     result = ev.get_type(val)
     self.assertEqual(expected, result)
Example #17
0
 def test_gettype_wheeldraw_returnsHIGHCARD(self):
     h = tools.make('wheeldraw')
     val = ev.get_value(h)
     expected = 'HIGH CARD'
     result = ev.get_type(val)
     self.assertEqual(expected, result)
Example #18
0
 def test_gettype_flushlow_returns(self):
     h = tools.make('flush_low')
     val = ev.get_value(h)
     expected = 'FLUSH'
     result = ev.get_type(val)
     self.assertEqual(expected, result)
Example #19
0
 def test_gettype_straightflushhigh_returnsSTRAIGHTFLUSH(self):
     h = tools.make('straightflush_high')
     val = ev.get_value(h)
     expected = 'STRAIGHT FLUSH'
     result = ev.get_type(val)
     self.assertEqual(expected, result)
Example #20
0
 def test_gettype_negativevalue_returnsINVALID(self):
     expected = 'INVALID'
     result = evaluator.get_type(-1)
     self.assertEqual(expected, result)