예제 #1
0
 def test_prime_number(self):
     self.assertEqual(prime_number(10), [2, 3, 5, 7])
예제 #2
0
 def test_result_not_a_dictionary(self):
     self.assertNotEqual(prime_number(10), {})
예제 #3
0
 def test_result_not_string(self):
     self.assertNotEqual(prime_number(10), "")
예제 #4
0
 def test_result_not_none(self):
     self.assertNotEqual(prime_number(10), None)
예제 #5
0
 def test_for_input_greater_than_2(self):
     self.assertEqual(prime_number(1), "Input must be greater than 2")
예제 #6
0
 def test_for_string(self):
     self.assertEqual(prime_number("100"),
                      "Invalid Input!!Only numbers allowed")
예제 #7
0
 def test_for_large_no(self):
     self.assertEqual(prime_number(100), [
         2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61,
         67, 71, 73, 79, 83, 89, 97
     ])
예제 #8
0
 def test_negative(self):
     self.assertEqual(prime_number(-10), "only positive numbers allowed")