1"""Test for multiprocess prime generation.""" 2 3import unittest 4 5import rsa.prime 6import rsa.parallel 7import rsa.common 8 9 10class ParallelTest(unittest.TestCase): 11 """Tests for multiprocess prime generation.""" 12 13 def test_parallel_primegen(self): 14 p = rsa.parallel.getprime(1024, 3) 15 16 self.assertFalse(rsa.prime.is_prime(p - 1)) 17 self.assertTrue(rsa.prime.is_prime(p)) 18 self.assertFalse(rsa.prime.is_prime(p + 1)) 19 20 self.assertEqual(1024, rsa.common.bit_size(p)) 21