def test_num_to_point_many(self): """ test that numbers get mapped to unique points """ card = 1000 nums = range(card) points = [pub.num_to_point(num) for num in nums] self.assertEqual(len(set(points)), card)
def test_num_to_point_to_num(self): for num in range(15*8)[::4]: p = pub.num_to_point(2**num) self.assertEqual(pub.point_to_num(p), 2**num)
def test_num_to_point_one(self): p = pub.num_to_point(1) self.assertTrue(p.is_valid())