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), ]
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())
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)
def test_1(self): card1 = Card(Suit.SPADES, Rank.ACE) card2 = Card(Suit.SPADES, Rank.ACE) self.assertTrue(card1 == card2)
def get_discard_card(i: int) -> Card: val = i - 4 return Card.from_value(val)
def DISCARD(card: Card): return 4 + card.value()