Ejemplo n.º 1
0
 def test_sort_suit(self):
     hand = Hand([Card("♦", 2), Card("♠", 2), Card("♣", 2), Card("♥", 2)])
     hand.sort(deck.HandSort.Default)
     assert "".join(c.suit.value for c in hand) == "♣♦♥♠"
     hand.sort(deck.HandSort.Default, reverse=True)
     assert "".join(c.suit.value for c in hand) == "♠♥♦♣"
Ejemplo n.º 2
0
 def test_poker_sort(self):
     hand = Hand(self.HAND1)
     hand.sort(deck.HandSort.Poker)
     assert [c.value.value for c in hand] == [2, 3, 15, 11, 11]
     hand.sort(deck.HandSort.Poker, reverse=True)
     assert [c.value.value for c in hand] == [11, 11, 15, 3, 2]
Ejemplo n.º 3
0
 def test_default_sort(self):
     hand = Hand(self.HAND1)
     hand.sort(deck.HandSort.Default)
     assert [c.value.value for c in hand] == [2, 3, 11, 11, 15]
     hand.sort(deck.HandSort.Default, reverse=True)
     assert [c.value.value for c in hand] == [15, 11, 11, 3, 2]