def test_with_two(self): self.assertEqual(prime_generator(2), [2])
def test_numbers_less_than_two(self): self.assertEqual(prime_generator(0), "The number has to be greater than 1")
def test_with_one(self): self.assertEqual(prime_generator(1), "The number has to be greater than 1")
def test_list_argument(self): with self.assertRaises(TypeError): prime_generator([2, 5, 7])
def test_negative_numbers(self): self.assertEqual(prime_generator(-12), "The number has to be greater than 1")
def test_correct_input(self): self.assertEquals(prime_generator(13), [2, 3, 5, 7, 11, 13])
def test_number_one(self): self.assertEqual(testcases.prime_generator(1), [])
def test_negative_numbers(self): self.assertEqual(testcases.prime_generator(-5), "Negative numbers not allowed.")
def test_prime_generator(self): self.assertEqual(testcases.prime_generator(10), [2, 3, 5, 7])
def test_prime_4(self): self.assertEqual(testcases.prime_generator(4), "Number is not prime")
def test_empty_parameter(self): self.assertRaises(testcases.prime_generator(), " No parameter provided")
def test_prime_50(self): self.assertEqual( testcases.prime_generator(50), [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47])
def test_prime_numbers_100(self): self.assertEqual(testcases.prime_generator(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 ])
def test_number_zero(self): self.assertEqual(testcases.prime_generator(0), [])
def test_with_three(self): self.assertEqual(prime_generator(3), [2, 3])
def test_return_list_for_valid_input(self): self.assertIsInstance(prime_generator(8), list)
def test_with_large_num(self): my_list = [ 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67 ] self.assertEqual(prime_generator(70), my_list)
def test_float_nums(self): with self.assertRaises(TypeError): prime_generator(9.23)
def test_incorrect_data_types(self): with self.assertRaises(TypeError): prime_generator("test")
def test_int(self): self.assertEqual(testcases.prime_generator("str"), "Only integers allowed")