def test_mult_inv(self): for n in range(4096, 8192): if not is_prime(n): continue m = mult_inv(n, 8192) self.assertEqual(n * mult_inv(n, 8192) % 8192, 1, m)
def test_is_prime(self): self.assertTrue(is_prime(2)) for i in range(3000 + 1, 4000 + 1): self.assertEqual(is_prime(i), is_really_prime(i), i)