コード例 #1
0
 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)
コード例 #2
0
 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))
コード例 #3
0
 def test_invalid(self):
     with self.assertRaises(InvalidInstance):
         Card.from_mask(1)
     with self.assertRaises(InvalidInstance):
         Card(10, 10)