Esempio n. 1
0
 def test_comparison(self):
     card = Card.from_string("8C")
     assert card > Card.from_string("6C")
     assert card > Card.from_string("6H")
     assert card < Card.from_string("JC")
     assert card < Card.from_string("JH")
     # same card (should never happen)
     assert card == Card.from_string("8C")
     # same value, different suit.
     assert card == Card.from_string("8H")
Esempio n. 2
0
 def test_from_string(self, string_repr, value, suit):
     card = Card.from_string(string_repr)
     assert card.value == value
     assert card.suit == suit
Esempio n. 3
0
 def from_string(cls, string_repr):
     return cls((Card.from_string(s) for s in string_repr.split()))