def setUp(self): print("setUp") self.prime_checker = primechecker.PrimeChecker(100)
def setUp(self): self.prime_checker = primechecker.PrimeChecker(100)
def test_object_type(self): obj = primechecker.PrimeChecker() self.assertEqual(True, type(obj) is primechecker.PrimeChecker, msg='should be of type `PrimeChecker`')
def test_is_prime_five(self): prime = primechecker.PrimeChecker('') self.assertEqual(False, prime.is_prime(), msg='should return false for ""')
def test_is_prime_four(self): prime = primechecker.PrimeChecker('3') self.assertEqual(True, prime.is_prime(), msg='should return true for 41')
def test_is_prime_three(self): prime = primechecker.PrimeChecker('67') self.assertEqual(True, prime.is_prime(), msg='should return false for 68')
def test_obj_instance(self): obj = primechecker.PrimeChecker() self.assertIsInstance(obj, primechecker.PrimeChecker, msg='should be an instance of `PrimeChecker`')