Пример #1
0
 def test_complex_string_true(self):
     # testing with basic string
     print("\n")
     string = "{ < : [ 12345 abCdDcBA 54321 [ : < {"
     p = lab1.isPalindrome(string)
     print("The string being tested is -> ", string)
     self.assertEqual(p, True)
     print("\n")
Пример #2
0
 def test_basic_string_true(self):
     # testing with basic string
     print("\n")
     string = "hannah"
     p = lab1.isPalindrome(string)
     print("The string being tested is -> ", string)
     self.assertEqual(p, True)
     print("\n")
Пример #3
0
 def test_complex_string_false(self):
     # testing with basic string
     print("\n")
     string = "{(< .AAba. >)}"
     p = lab1.isPalindrome(string)
     print("The string being tested is -> ", string)
     self.assertEqual(p, False)
     print("\n")
Пример #4
0
 def test_basic_string_false(self):
     # testing with basic string
     print("\n")
     string = "hello"
     p = lab1.isPalindrome(string)
     print("The string being tested is -> ", string)
     self.assertEqual(p, False)
     print("\n")
Пример #5
0
 def test_string_with_spaces(self):
     # testing with string with spaces
     print("\n")
     string = "ni t I n"
     p = lab1.isPalindrome(string)
     print("The string being tested is -> ", string)
     print("Is the string a palindrome?: ", p)
     self.assertEqual(p, True)
     print("\n")
Пример #6
0
 def test_single_character_string(self):
     # testing with single character string
     print("\n")
     string = "h"
     p = lab1.isPalindrome(string)
     print("The string being tested is -> ", string)
     print("Is the string a palindrome?: ", p)
     self.assertEqual(p, True)
     print("\n")
Пример #7
0
 def test_empty_string(self):
     # testing with empty string
     print("\n")
     string = ""
     p = lab1.isPalindrome(string)
     print("The string being tested is -> ", string)
     print("Is the string a palindrome?: ", p)
     self.assertEqual(p, True)
     print("\n")
Пример #8
0
 def test_isPalindrome(self):
     print()
     print('Testing isPalindrome and isPalindromeEC')
     for s in ('ni t I n', 'aabacabaa', '{(<<({', '344484443', 'abcde'):
         self.assertEqual(lab1.isPalindrome(s), lab1.isPalindromeEC(s))