Esempio n. 1
0
 def test_input_value(self):
     with self.assertRaises(ValueError):
         find_largest_pandigital_prime(-1, 2)
         find_largest_pandigital_prime(1, 0)
         find_largest_pandigital_prime(8, 2)
         find_largest_pandigital_prime(1, 10)
         find_largest_pandigital_prime(0, 7)
Esempio n. 2
0
 def test_main_function(self):
     self.assertEqual(
         find_largest_pandigital_prime(1, 9), 7652413,
         'the result of the function does not match the expected result.')
     self.assertEqual(
         find_largest_pandigital_prime(1, 3), "NA",
         'the result of the function does not match the expected result.')
     self.assertEqual(
         find_largest_pandigital_prime(5, 6), "NA",
         'the result of the funtion does not match the expected result.')
     self.assertEqual(
         find_largest_pandigital_prime(8, 9), "NA",
         'the result of the function does not match the expeced result.')
     self.assertEqual(
         find_largest_pandigital_prime(5, 7), 7652413,
         'the result of the function does not match the expected result.')
Esempio n. 3
0
 def test_input_type(self):
     with self.assertRaises(TypeError):
         find_largest_pandigital_prime(5j, 5)
         find_largest_pandigital_prime(1, 2j)
         find_largest_pandigital_prime("yes", 5)
         find_largest_pandigital_prime(1, "no")