Exemplo n.º 1
0
 def test_other_string_size(self):
     str1 = 'a'
     str2 = 'asd'
     self.assertEqual(string_rotation.is_rotation(str1, str2), False)
Exemplo n.º 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)
Exemplo n.º 3
0
 def test_empty_string(self):
     str1 = ''
     str2 = ''
     self.assertEqual(string_rotation.is_rotation(str1, str2), True)
Exemplo n.º 4
0
 def test_different_length(self):
     self.assertFalse(is_rotation("Hi", "Hi there"))
Exemplo n.º 5
0
 def test_empty_string(self):
     self.assertTrue(is_rotation("", ""))
Exemplo n.º 6
0
 def test_is_rotation(self):
     self.assertTrue(is_rotation("Hello", "lloHe"))
Exemplo n.º 7
0
 def test_is_not_rotation(self):
     self.assertFalse(is_rotation("Hello", "World"))