Example #1
0
 def test_other_string_size(self):
     str1 = 'a'
     str2 = 'asd'
     self.assertEqual(string_rotation.is_rotation(str1, str2), False)
Example #2
0
 def rotation_test(self, strings, rotations, answers):
     for i, triple in enumerate(zip(strings, rotations, answers)):
         string, rotation, answer = triple
         with self.subTest(i=i):
             self.assertEqual(string_rotation.is_rotation(string, rotation),
                              answer)
Example #3
0
 def test_empty_string(self):
     str1 = ''
     str2 = ''
     self.assertEqual(string_rotation.is_rotation(str1, str2), True)
 def test_different_length(self):
     self.assertFalse(is_rotation("Hi", "Hi there"))
 def test_empty_string(self):
     self.assertTrue(is_rotation("", ""))
 def test_is_rotation(self):
     self.assertTrue(is_rotation("Hello", "lloHe"))
 def test_is_not_rotation(self):
     self.assertFalse(is_rotation("Hello", "World"))