def test_mask(self): card = Card(Card.SUIT_LOWER, Card.RANK_TWO) self.assertEqual(card.mask, l2.mask) self.assertEqual(Card.from_mask(l2.mask), card)
def test_eq(self): self.assertEqual(Card.from_mask(Card.LOWER_THREE.mask), Card.from_mask(Card.LOWER_THREE.mask)) self.assertEqual(Card.from_mask(Card.LOWER_THREE.mask), Card(Card.SUIT_LOWER, Card.RANK_THREE))
def test_invalid(self): with self.assertRaises(InvalidInstance): Card.from_mask(1) with self.assertRaises(InvalidInstance): Card(10, 10)