def test_long_with_spaces(self): str_ = ("zw pfli tfuv nfibj tfiivtkcp pfl jyflcu " "sv rscv kf ivru kyzj") res = pytest.rotate(str_, -17) res = pytest.rotate(res, 17) self.assertEqual(res, str_)
def test_single_back_and_forth(self): res = pytest.rotate('dave', 5) self.assertEqual(res, 'ifaj') res = pytest.rotate(res, -5) self.assertEqual(res, 'dave')
def test_single_a_z(self): res = pytest.rotate('z', 1) self.assertEqual(res, 'a') res = pytest.rotate(res, -1) self.assertEqual(res, 'z')
def test_single_circular(self): res = pytest.rotate('sarah', 13) self.assertEqual(res, 'fnenu') res = pytest.rotate(res, 13) self.assertEqual(res, 'sarah')