def test_straight(self): cards = [ Card(4, Suit.hearts), Card(5, Suit.clubs), Card(6, Suit.clubs), Card(7, Suit.clubs), Card(8, Suit.clubs) ] self.assertEqual(Hand(cards).type, HandType.straight) cards = [ Card(1, Suit.hearts), Card(2, Suit.clubs), Card(3, Suit.clubs), Card(4, Suit.clubs), Card(5, Suit.clubs) ] self.assertEqual(Hand(cards).type, HandType.straight) cards = [ Card(1, Suit.hearts), Card(10, Suit.clubs), Card(11, Suit.clubs), Card(12, Suit.clubs), Card(13, Suit.clubs) ] self.assertEqual(Hand(cards).type, HandType.straight)
def test_side_pair(self): cards = [ Card(2, Suit.hearts), Card(2, Suit.spades), Card(3, Suit.diamonds) ] self.assertEqual(Hand(cards).type_side, HandType.pair_side)
def test_side_three_of_kind(self): cards = [ Card(2, Suit.hearts), Card(2, Suit.diamonds), Card(2, Suit.spades) ] self.assertEqual(Hand(cards).type_side, HandType.three_of_kind_side)
def test_side_flush(self): cards = [ Card(2, Suit.hearts), Card(4, Suit.hearts), Card(6, Suit.hearts) ] self.assertEqual(Hand(cards).type_side, HandType.flush_side)
def test_side_royal(self): cards = [ Card(11, Suit.hearts), Card(12, Suit.hearts), Card(13, Suit.hearts) ] self.assertEqual(Hand(cards).type_side, HandType.mini_royal)
def test_three_of_kind(self): cards = [ Card(1, Suit.hearts), Card(1, Suit.clubs), Card(1, Suit.diamonds), Card(2, Suit.clubs), Card(3, Suit.clubs) ] self.assertEqual(Hand(cards).type, HandType.three_of_kind)
def test_flush(self): cards = [ Card(2, Suit.clubs), Card(4, Suit.clubs), Card(6, Suit.clubs), Card(8, Suit.clubs), Card(10, Suit.clubs) ] self.assertEqual(Hand(cards).type, HandType.flush)
def test_full_house(self): cards = [ Card(4, Suit.clubs), Card(4, Suit.hearts), Card(4, Suit.diamonds), Card(8, Suit.spades), Card(8, Suit.clubs) ] self.assertEqual(Hand(cards).type, HandType.full_house)
def test_four_of_kind(self): cards = [ Card(4, Suit.clubs), Card(4, Suit.hearts), Card(4, Suit.diamonds), Card(4, Suit.spades), Card(8, Suit.clubs) ] self.assertEqual(Hand(cards).type, HandType.four_of_kind)
def test_straight_flush(self): cards = [ Card(4, Suit.clubs), Card(5, Suit.clubs), Card(6, Suit.clubs), Card(7, Suit.clubs), Card(8, Suit.clubs) ] self.assertEqual(Hand(cards).type, HandType.straight_flush)
def test_payout(self): cards = [ Card(3, Suit.hearts), Card(5, Suit.clubs), Card(6, Suit.diamonds), Card(7, Suit.clubs), Card(8, Suit.clubs) ] self.assertEqual(Hand(cards).payout(1), 0) cards = [ Card(1, Suit.hearts), Card(1, Suit.clubs), Card(1, Suit.diamonds), Card(2, Suit.clubs), Card(3, Suit.clubs) ] self.assertEqual(Hand(cards).payout(1), 3 + 1)
def test_royal_flush(self): cards = [ Card(1, Suit.clubs), Card(10, Suit.clubs), Card(11, Suit.clubs), Card(12, Suit.clubs), Card(13, Suit.clubs) ] self.assertEqual(Hand(cards).type, HandType.royal_flush)
def test_high(self): cards = [ Card(3, Suit.hearts), Card(5, Suit.clubs), Card(6, Suit.diamonds), Card(7, Suit.clubs), Card(8, Suit.clubs) ] self.assertEqual(Hand(cards).type, HandType.high)
def test_pair(self): cards = [ Card(1, Suit.hearts), Card(2, Suit.clubs), Card(2, Suit.diamonds), Card(3, Suit.clubs), Card(4, Suit.clubs) ] self.assertEqual(Hand(cards).type, HandType.pair)
def test_side_straight(self): cards = [ Card(4, Suit.hearts), Card(5, Suit.diamonds), Card(6, Suit.spades) ] self.assertEqual(Hand(cards).type_side, HandType.straight_side) cards = [ Card(12, Suit.hearts), Card(13, Suit.diamonds), Card(1, Suit.spades) ] self.assertEqual(Hand(cards).type_side, HandType.straight_side) cards = [ Card(1, Suit.hearts), Card(2, Suit.diamonds), Card(3, Suit.spades) ] self.assertEqual(Hand(cards).type_side, HandType.straight_side)