예제 #1
0
 def test_float(self):
     with self.assertRaises(Exception):
         prime3.factor_list(13.7)
예제 #2
0
 def test_square(self):
     lst = prime3.factor_list(25)
     self.assertEqual(lst, [1, 5, 25])
예제 #3
0
 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)
예제 #4
0
 def test_prime(self):
     lst = prime3.factor_list(23)
     self.assertEqual(lst, [1, 23])
예제 #5
0
 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)
예제 #6
0
 def test_float(self):
     with self.assertRaises(Exception):
         prime3.factor_list(13.7)
예제 #7
0
 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)
예제 #8
0
 def test_square(self):
     lst = prime3.factor_list(25)
     self.assertEqual(lst, [1, 5, 25])
예제 #9
0
 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)
예제 #10
0
 def test_prime(self):
     lst = prime3.factor_list(23)
     self.assertEqual(lst, [1, 23])