def setUp(self) -> None:
     self.hand = [
         Card(Suit.CLUBS, Rank.ACE),
         Card(Suit.DIAMONDS, Rank.ACE),
         Card(Suit.SPADES, Rank.ACE),
         Card(Suit.CLUBS, Rank.FOUR),
         Card(Suit.CLUBS, Rank.FIVE),
         Card(Suit.CLUBS, Rank.SIX),
         Card(Suit.CLUBS, Rank.SEVEN),
         Card(Suit.DIAMONDS, Rank.QUEEN),
         Card(Suit.HEARTS, Rank.TEN),
         Card(Suit.HEARTS, Rank.FOUR),
     ]
    def setUp(self) -> None:
        self.player_hand = [
            Card(Suit.CLUBS, Rank.ACE),
            Card(Suit.DIAMONDS, Rank.ACE),
            Card(Suit.SPADES, Rank.ACE),
            Card(Suit.CLUBS, Rank.FOUR),
            Card(Suit.CLUBS, Rank.FIVE),
            Card(Suit.CLUBS, Rank.SIX),
        ]

        self.opponent_hand = [
            Card(Suit.CLUBS, Rank.SEVEN),
            Card(Suit.HEARTS, Rank.SEVEN),
            Card(Suit.DIAMONDS, Rank.SEVEN),
            Card(Suit.SPADES, Rank.SEVEN),
            Card(Suit.HEARTS, Rank.ACE),
            Card(Suit.HEARTS, Rank.FOUR),
        ]
Пример #3
0
 def test_4(self):
     card1 = Card(Suit.SPADES, Rank.ACE)
     card1_value = card1.value()
     card2 = Card.from_value(card1_value)
     self.assertTrue(card1.value() == card2.value())
Пример #4
0
 def test_2(self):
     card1 = Card(Suit.SPADES, Rank.ACE)
     card2 = Card(Suit.SPADES, Rank.ACE)
     card_set = {card1}
     self.assertTrue(card2 in card_set)
Пример #5
0
 def test_1(self):
     card1 = Card(Suit.SPADES, Rank.ACE)
     card2 = Card(Suit.SPADES, Rank.ACE)
     self.assertTrue(card1 == card2)
Пример #6
0
 def get_discard_card(i: int) -> Card:
     val = i - 4
     return Card.from_value(val)
Пример #7
0
 def DISCARD(card: Card):
     return 4 + card.value()