def testExplanation(self): result = primeChecker(32) self.assertFalse(result[0]) expected_explanation = "2 times 16 is 32" self.assertEqual(result[1], expected_explanation) result = primeChecker(582) expected_explanation = '2 times 291 is 582' self.assertEqual(result[1], expected_explanation)
def testNonPrimes(self): # 1 digit result = primeChecker(8) self.assertFalse(result[0]) # 2 digit result = primeChecker(33) self.assertFalse(result[0]) # 3 digit result = primeChecker(112) self.assertFalse(result[0])
def testPrimes(self): # 1 digit result = primeChecker(7) self.assertTrue(result[0]) # 2 digit result = primeChecker(31) self.assertTrue(result[0]) # 3 digit result = primeChecker(113) self.assertTrue(result[0])
def testExplanation(self): result = primeChecker(32) self.assertFalse(result[0]) expected_explanation = "2 times 16 is 32" self.assertEqual(result[1], expected_explanation)
def testNonPrimes(self): result = primeChecker(8) self.assertFalse(result[0]) result = primeChecker(582) self.assertFalse(result[0])