Exemplo n.º 1
0
 def testGetPrimeFactors(self):
     self.assertEquals( [11], PrimeFactors.generate(11) )
     self.assertEquals( [2,5], PrimeFactors.generate(10) )
     self.assertEquals( [2, 11], PrimeFactors.generate(22) )
     self.assertEquals( [2,2,2,5], PrimeFactors.generate(40) )
     self.assertEquals( [2,2,2,2,5], PrimeFactors.generate(80) )
     self.assertEquals( [2,2,2,2,5,5,5,5], PrimeFactors.generate(10000) )
Exemplo n.º 2
0
 def testIsPrime(self):       
     self.assertFalse( PrimeFactors.isPrime(22) )
     self.assertFalse( PrimeFactors.isPrime(15) )
     self.assertFalse( PrimeFactors.isPrime(4) )