Example #1
0
 def test_autodiscard_2pair_returns1card(self):
     # [('A', 's'), ('A', 'h'), ('K', 's'), ('K', 'd'), ('Q', 'c')]
     h = hand.Hand(tools.make('twopair_high'))
     h.unhide()
     expected = ['Qc']
     result = [repr(c) for c in sorted(discard.auto_discard(h))]
     self.assertEqual(expected, result)
Example #2
0
 def test_autodiscard_BDSD2_returns2cards(self):
     # [('2', 'd'), ('7', 's'), ('8', 's'), ('9', 'd'), ('K', 'h')]
     h = hand.Hand(tools.make('BDSD2'))
     h.unhide()
     expected = ['2d', 'Kh']
     result = [repr(c) for c in sorted(discard.auto_discard(h))]
     self.assertEqual(expected, result)
Example #3
0
 def test_autodiscard_junk_returns(self):
     #  [('2', 'd'), ('3', 's'), ('6', 's'), ('8', 'd'), ('T', 'h')]
     h = hand.Hand(tools.make('junk'))
     h.unhide()
     expected = ['2d', '3s', '6s']
     result = [repr(c) for c in sorted(discard.auto_discard(h))]
     self.assertEqual(expected, result)
Example #4
0
 def test_autodiscard_acehigh_returns4cards(self):
     # [('A', 'd'), ('4', 's'), ('5', 's'), ('7', 's'), ('9', 'h')]
     h = hand.Hand(tools.make('acehigh'))
     h.unhide()
     expected = ['4s', '5s', '7s', '9h']
     result = [repr(c) for c in sorted(discard.auto_discard(h))]
     self.assertEqual(expected, result)
Example #5
0
 def test_autodiscard_highcards_returns2cards(self):
     # [('A', 'd'), ('4', 's'), ('Q', 's'), ('7', 's'), ('K', 'h')]
     h = hand.Hand(tools.make('highcards'))
     h.unhide()
     expected = ['4s', '7s']
     result = [repr(c) for c in sorted(discard.auto_discard(h))]
     self.assertEqual(expected, result)
Example #6
0
 def test_autodiscard_wheel_returns(self):
     # [('3', 'h'), ('4', 's'), ('A', 's'), ('2', 'd'), ('K', 'h')]
     h = hand.Hand(tools.make('wheeldraw'))
     h.unhide()
     expected = ['Kh']
     result = [repr(c) for c in sorted(discard.auto_discard(h))]
     self.assertEqual(expected, result)
Example #7
0
 def test_autodiscard_GSSD_returns(self):
     # [('J', 'h'), ('T', 's'), ('A', 's'), ('2', 'd'), ('K', 'h')]
     h = hand.Hand(tools.make('GSSD'))
     h.unhide()
     expected = ['2d']
     result = [repr(c) for c in sorted(discard.auto_discard(h))]
     self.assertEqual(expected, result)
Example #8
0
 def test_autodiscard_flushdraw_returns1card(self):
     # [('A', 's'), ('T', 's'), ('7', 's'), ('2', 'd'), ('9', 's')]
     h = hand.Hand(tools.make('flushdrawA'))
     h.unhide()
     expected = ['2d']
     result = [repr(c) for c in sorted(discard.auto_discard(h))]
     self.assertEqual(expected, result)
Example #9
0
 def test_autodiscard_quads_returns1card(self):
     # [('A', 's'), ('A', 'd'), ('A', 'h'), ('A', 'c'), ('K', 'c')]
     h = hand.Hand(tools.make('quads_high'))
     h.unhide()
     expected = ['Kc']
     result = [repr(c) for c in sorted(discard.auto_discard(h))]
     #  result = sorted([repr(c) for c in draw5.auto_discard(h)])
     self.assertEqual(expected, result)
Example #10
0
 def test_autodiscard_straight_returnsEmptyList(self):
     h = hand.Hand(tools.make('straight_mid'))
     h.unhide()
     expected = []
     result = [repr(c) for c in sorted(discard.auto_discard(h))]
     self.assertEqual(expected, result)