def test_split_path_invalid_path(self):
     try:
         s3_token.split_path('o\nn e', 2)
     except ValueError as err:
         self.assertEqual(str(err), 'Invalid path: o%0An%20e')
     try:
         s3_token.split_path('o\nn e', 2, 3, True)
     except ValueError as err:
         self.assertEqual(str(err), 'Invalid path: o%0An%20e')
 def test_split_path_invalid_path(self):
     try:
         s3_token.split_path('o\nn e', 2)
     except ValueError as err:
         self.assertEqual(str(err), 'Invalid path: o%0An%20e')
     try:
         s3_token.split_path('o\nn e', 2, 3, True)
     except ValueError as err:
         self.assertEqual(str(err), 'Invalid path: o%0An%20e')
 def test_split_path_success(self):
     self.assertEqual(s3_token.split_path('/a'), ['a'])
     self.assertEqual(s3_token.split_path('/a/'), ['a'])
     self.assertEqual(s3_token.split_path('/a/c', 2), ['a', 'c'])
     self.assertEqual(s3_token.split_path('/a/c/o', 3), ['a', 'c', 'o'])
     self.assertEqual(s3_token.split_path('/a/c/o/r', 3, 3, True),
                      ['a', 'c', 'o/r'])
     self.assertEqual(s3_token.split_path('/a/c', 2, 3, True),
                      ['a', 'c', None])
     self.assertEqual(s3_token.split_path('/a/c/', 2), ['a', 'c'])
     self.assertEqual(s3_token.split_path('/a/c/', 2, 3), ['a', 'c', ''])
 def test_split_path_success(self):
     self.assertEqual(s3_token.split_path('/a'), ['a'])
     self.assertEqual(s3_token.split_path('/a/'), ['a'])
     self.assertEqual(s3_token.split_path('/a/c', 2), ['a', 'c'])
     self.assertEqual(s3_token.split_path('/a/c/o', 3), ['a', 'c', 'o'])
     self.assertEqual(s3_token.split_path('/a/c/o/r', 3, 3, True),
                      ['a', 'c', 'o/r'])
     self.assertEqual(s3_token.split_path('/a/c', 2, 3, True),
                      ['a', 'c', None])
     self.assertEqual(s3_token.split_path('/a/c/', 2), ['a', 'c'])
     self.assertEqual(s3_token.split_path('/a/c/', 2, 3), ['a', 'c', ''])