def test9(self): a = [0, 3, 8, 15, 24, 35] result1 = testquestions().series(6) self.assertEqual(result1, []) b = [0, 3, 8, 15, 24, 35, 48, 63, 80] result2 = testquestions().series(9) self.assertEqual(result2, [])
def test8(self): a1 = "HOW DO YOU DO?" a = "DO DO HOW YOU" result1 = testquestions().potential(a1) self.assertEqual(result1, a) b1 = "THE SKY IS THE LIMIT" b = "IS THE THE SKY LIMIT" result2 = testquestions().potential(b1) self.assertEqual(result2, b)
def test7(self): a1 = "Harry Potter was a highly unusual boy in many ways. For one thing, he hated the summer holidays more than any other time of year. For another, he really wanted to do his homework, but was forced to do it in secret, in the dead of the night. And he also happened to be a wizard." a = [382, 7] result1 = testquestions().average_String(a1) self.assertEqual(result1, []) b1 = "The best things in an artist’s work are so much a matter of intuition, that there is much to be said for the point of view that would altogether discourage intellectual inquiry into artistic phenomena on the part of the artist. Intuitions are shy things and apt to disappear if looked into too closely. And there is undoubtedly a danger that too much knowledge and training may supplant the natural intuitive feeling of a student, leaving only a cold knowledge of the means of expression in its place. For the artist, if he has the right stuff in him ..." b = [448, 4] result2 = testquestions().average_String(b1) self.assertEqual(result2, [])
def test4(self): a1 = [1, 2, 8, 3, 11, 121, 300, 22] a = [2, 3, 11, 22] result1 = testquestions().Super_Palindrome(a1) self.assertEqual(result1, a) b1 = [101, 4, 8, 9, 111, 121, 300, 22] b = [101, 111, 121, 22] result2 = testquestions().Super_Palindrome(b1) self.assertEqual(result2, b)
def test6(self): result = testquestions().find_gcd(12, 16) self.assertEqual(result, 99) result = testquestions().find_gcd(250, 1000) self.assertEqual(result, 99)
def test1(self): result = testquestions().divide(1, 1) self.assertEqual(1, result)
def test5(self): result = testquestions().trueorfalse(13) self.assertEqual(result, 1) result = testquestions().trueorfalse(23) self.assertEqual(result, 1)
def test3(self): result1 = testquestions().multiply_Strings("50", "4") self.assertEqual(result1, 99) result2 = testquestions().multiply_Strings("150", "2") self.assertEqual(result2, 99)
def test2(self): string1 = "abcbea" result = testquestions().almost_palindrome(string1) self.assertEqual(result, 0)
def test10(self): result1 = testquestions().filename("helloworld.java") result1 = result1.split('.') self.assertEqual(result1, ".java") result2 = testquestions().filename("helloworld") self.assertEqual(result2, "Not a file name")