def test_sort_order(self): cards = Card.from_masks([d3.mask, d4.mask]) cards.sort() self.assertListEqual([card.mask for card in cards], [d3.mask, d4.mask]) cards = Card.from_masks([d4.mask, d3.mask]) cards.sort() self.assertListEqual([card.mask for card in cards], [d3.mask, d4.mask])
def test_masks(self): card = Card(Card.SUIT_DIAMOND, Card.RANK_TWO) card2 = Card(Card.SUIT_DIAMOND, Card.RANK_THREE) self.assertListEqual(Card.from_masks([d2.mask, d3.mask]), [card, card2])