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)
def test_prime_num_for_success(self): ip = 5 expected = True result = prime_num(ip) self.assertEqual(expected, result)
def test_prime_num_for_None(self): ip = None expected = None result = prime_num(ip) self.assertEqual(expected, result)
def test_prime_num_for_failure(self): ip = 8 expected = False result = prime_num(ip) self.assertEqual(expected, result)
def test6(self): temp_num=100 result= prime_number.prime_num(temp_num) self.assertAlmostEqual(result,False)
def test3(self): temp_num= 97 result= prime_number.prime_num(temp_num) self.assertAlmostEqual(result,True)