def test_equals_7(self):
     self.assertEqual(longest_palindrome(
         'Fourscoreandsevenyearsagoourfaathersbroughtforthonthiscontainen'
         'tanewnationconceivedinzLibertyanddedicatedtothepropositionthata'
         'llmenarecreatedequalNowweareengagedinagreahtcivilwartestingwhet'
         'herthatnaptionoranynartionsoconceivedandsodedicatedcanlongendur'
         'eWeareqmetonagreatbattlefiemldoftzhatwarWehavecometodedicpateap'
         'ortionofthatfieldasafinalrestingplaceforthosewhoheregavetheirli'
         'vesthatthatnationmightliveItisaltogetherfangandproperthatweshou'
         'lddothisButinalargersensewecannotdedicatewecannotconsecrateweca'
         'nnothallowthisgroundThebravelmenlivinganddeadwhostruggledhereha'
         'veconsecrateditfaraboveourpoorponwertoaddordetractTgheworldadsw'
         'filllittlenotlenorlongrememberwhatwesayherebutitcanneverforgetw'
         'hattheydidhereItisforusthelivingrathertobededicatedheretotheuln'
         'finishedworkwhichtheywhofoughtherehavethusfarsonoblyadvancedIti'
         'sratherforustobeherededicatedtothegreattdafskremainingbeforeust'
         'hatfromthesehonoreddeadwetakeincreaseddevotiontothatcauseforwhi'
         'chtheygavethelastpfullmeasureofdevotionthatweherehighlyresolvet'
         'hatthesedeadshallnothavediedinvainthatthisnationunsderGodshallh'
         'aveanewbirthoffreedomandthatgovernmentofthepeoplebythepeoplefor'
         'thepeopleshallnotperishfromtheearth'), 7
     )
示例#2
0
 def test_equals_7(self):
     self.assertEqual(
         longest_palindrome(
             'Fourscoreandsevenyearsagoourfaathersbroughtforthonthiscontainen'
             'tanewnationconceivedinzLibertyanddedicatedtothepropositionthata'
             'llmenarecreatedequalNowweareengagedinagreahtcivilwartestingwhet'
             'herthatnaptionoranynartionsoconceivedandsodedicatedcanlongendur'
             'eWeareqmetonagreatbattlefiemldoftzhatwarWehavecometodedicpateap'
             'ortionofthatfieldasafinalrestingplaceforthosewhoheregavetheirli'
             'vesthatthatnationmightliveItisaltogetherfangandproperthatweshou'
             'lddothisButinalargersensewecannotdedicatewecannotconsecrateweca'
             'nnothallowthisgroundThebravelmenlivinganddeadwhostruggledhereha'
             'veconsecrateditfaraboveourpoorponwertoaddordetractTgheworldadsw'
             'filllittlenotlenorlongrememberwhatwesayherebutitcanneverforgetw'
             'hattheydidhereItisforusthelivingrathertobededicatedheretotheuln'
             'finishedworkwhichtheywhofoughtherehavethusfarsonoblyadvancedIti'
             'sratherforustobeherededicatedtothegreattdafskremainingbeforeust'
             'hatfromthesehonoreddeadwetakeincreaseddevotiontothatcauseforwhi'
             'chtheygavethelastpfullmeasureofdevotionthatweherehighlyresolvet'
             'hatthesedeadshallnothavediedinvainthatthisnationunsderGodshallh'
             'aveanewbirthoffreedomandthatgovernmentofthepeoplebythepeoplefor'
             'thepeopleshallnotperishfromtheearth'), 7)
 def test_equals_2(self):
     self.assertEqual(longest_palindrome("aa"), 2)
 def test_equals(self):
     self.assertEqual(longest_palindrome("a"), 1)
 def test_equals_6(self):
     self.assertEqual(longest_palindrome("baablkj12345432133d"), 9)
 def test_equals_5(self):
     self.assertEqual(longest_palindrome("abcdefghba"), 1)
示例#7
0
 def test_equals_2(self):
     self.assertEqual(longest_palindrome("aa"), 2)
示例#8
0
 def test_equals(self):
     self.assertEqual(longest_palindrome("a"), 1)
示例#9
0
 def test_equals_6(self):
     self.assertEqual(longest_palindrome("baablkj12345432133d"), 9)
示例#10
0
 def test_equals_5(self):
     self.assertEqual(longest_palindrome("abcdefghba"), 1)