Beispiel #1
0
    def test_prime_num_for_empty_string_or_string(self):
        #empty string input
        ip = ""
        expected = "Invalid input"
        result = prime_num(ip)
        self.assertEqual(expected, result)

        #string input
        ip = "aish"
        expected = "Invalid input"
        result = prime_num(ip)
        self.assertEqual(expected, result)
Beispiel #2
0
 def test_prime_num_for_success(self):
     ip = 5
     expected = True
     result = prime_num(ip)
     self.assertEqual(expected, result)
Beispiel #3
0
 def test_prime_num_for_None(self):
     ip = None
     expected = None
     result = prime_num(ip)
     self.assertEqual(expected, result)
Beispiel #4
0
 def test_prime_num_for_failure(self):
     ip = 8
     expected = False
     result = prime_num(ip)
     self.assertEqual(expected, result)
Beispiel #5
0
 def test6(self):
     temp_num=100
     result= prime_number.prime_num(temp_num)
     self.assertAlmostEqual(result,False)
Beispiel #6
0
 def test3(self):
     temp_num= 97
     result= prime_number.prime_num(temp_num)
     self.assertAlmostEqual(result,True)