예제 #1
0
 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_)
예제 #2
0
 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')
예제 #3
0
 def test_single_a_z(self):
     res = pytest.rotate('z', 1)
     self.assertEqual(res, 'a')
     res = pytest.rotate(res, -1)
     self.assertEqual(res, 'z')
예제 #4
0
 def test_single_circular(self):
     res = pytest.rotate('sarah', 13)
     self.assertEqual(res, 'fnenu')
     res = pytest.rotate(res, 13)
     self.assertEqual(res, 'sarah')