コード例 #1
0
 def test_when_check_if_palindrome_input_list(self):
     with self.assertRaises(AttributeError) as context:
         self.assertRaises(AttributeError, check_if_palindrome(['abccba', '123321']))
     exception_message = str(context.exception)
     self.assertEqual('Input isn`t string type', exception_message)
コード例 #2
0
 def test_when_check_if_palindrome_input_palindrome(self):
     palindrome = check_if_palindrome('abccba')
     expected_result = True
     self.assertEqual(palindrome, expected_result)
コード例 #3
0
 def test_when_check_if_palindrome_input_nonpalindrome(self):
     palindrome = check_if_palindrome('abcsdf cba')
     expected_result = False
     self.assertEqual(palindrome, expected_result)