def test_divisors_corner3(self): correctDivisors = [1,73] testDivisors = nfspolygen.findDivisors(73) correctDivisors.sort() testDivisors.sort() self.assertEqual(len(correctDivisors),len(testDivisors)) for i in range(len(correctDivisors)): self.assertEqual(correctDivisors[i], testDivisors[i])
def test_divisors2(self): n = 72 correctDivisors = [1, 2, 3, 4, 6, 8, 9, 12, 18, 24, 36, 72] testDivisors = nfspolygen.findDivisors(n) correctDivisors.sort() testDivisors.sort() self.assertEqual(len(correctDivisors),len(testDivisors)) for i in range(len(correctDivisors)): self.assertEqual(correctDivisors[i], testDivisors[i])
def test_divisors(self): n = 120 correctDivisors = [1,2,3,4,5,6,8,10,12,15,20,24,30,40,60,120] testDivisors = nfspolygen.findDivisors(n) correctDivisors.sort() testDivisors.sort() self.assertEqual(len(correctDivisors),len(testDivisors)) for i in range(len(correctDivisors)): self.assertEqual(correctDivisors[i], testDivisors[i])