def test_float(self): with self.assertRaises(Exception): prime3.factor_list(13.7)
def test_square(self): lst = prime3.factor_list(25) self.assertEqual(lst, [1, 5, 25])
def test_large(self): lst = prime3.factor_list(300) true_lst = [1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 25, 30, 50, 60, 75, 100, 150, 300] self.assertEqual(lst, true_lst)
def test_prime(self): lst = prime3.factor_list(23) self.assertEqual(lst, [1, 23])
def test_factorial(self): lst = prime3.factor_list(120) true_lst = [1, 2, 3, 4, 5, 6, 8, 10, 12, 15, 20, 24, 30, 40, 60, 120] self.assertEqual(lst, true_lst)
def test_large(self): lst = prime3.factor_list(300) true_lst = [ 1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 25, 30, 50, 60, 75, 100, 150, 300 ] self.assertEqual(lst, true_lst)