def setUp(self): self.test1 = is_prime_number(-1) self.test2 = is_prime_number(1) self.test3 = is_prime_number(1066340417491710595814572169) self.test4 = is_prime_number(10668) self.test5 = is_prime_number(5) self.test6 = is_prime_number("boy")
def test_one_is_not_prime(self): self.assertFalse(is_prime_number(1))
def test_four_is_not_prime(self): self.assertFalse(is_prime_number(4))
def test_5_to_9_are_prime(self): for number in get_prime_numbers(5,9): self.assertTrue(is_prime_number(number))
def test_1000000_to_1004_are_prime(self): for number in get_prime_numbers(1000000,1004): self.assertTrue(is_prime_number(number))
def test_five_is_prime(self): self.assertTrue(is_prime_number(5))
def test_1_to_4_are_prime(self): for number in get_prime_numbers(1,4): self.assertTrue(is_prime_number(number))
def test_seven_is_prime(self): self.assertTrue(is_prime_number(7))
def test_returns_false_if_number_is_less_than_2(self): for num in [-1, 0, 1]: self.assertEqual(prime_numbers.is_prime_number(num), False)
def test_it_works(self): self.assertEqual(prime_numbers.is_prime_number(10), False) self.assertEqual(prime_numbers.is_prime_number(7), True)
def test_works_with_the_first_prime_number(self): self.assertEqual(prime_numbers.is_prime_number(2), True)
def concat_are_prime(set_of_primes, n): for p in set_of_primes: if prime_numbers.is_prime_number(concat(p,n)) == False or prime_numbers.is_prime_number(concat(n,p)) == False: return False return True