|
|
@@ -273,6 +273,26 @@ class RazClientTest(unittest.TestCase):
|
|
|
assert_equal(response['access_type'], 'set-permission')
|
|
|
assert_equal(response['relative_path'], '/user/csso_hueuser/customers.csv')
|
|
|
|
|
|
+ # Rename
|
|
|
+ method = 'PUT'
|
|
|
+ relative_path = '/user/csso_hueuser/old_dir' # First call to fetch SAS to sign header path
|
|
|
+ url_params = {}
|
|
|
+
|
|
|
+ response = client.handle_adls_req_mapping(method, url_params, relative_path)
|
|
|
+
|
|
|
+ assert_equal(response['access_type'], 'rename-source')
|
|
|
+ assert_equal(response['relative_path'], '/user/csso_hueuser/old_dir')
|
|
|
+
|
|
|
+ method = 'PUT'
|
|
|
+ relative_path = '/user/csso_hueuser/new_dir'
|
|
|
+ headers = {'x-ms-rename-source': '/user/csso_hueuser/old_dir?some_sas_token'} # Second call having signed header path
|
|
|
+ url_params = {}
|
|
|
+
|
|
|
+ response = client.handle_adls_req_mapping(method, url_params, relative_path)
|
|
|
+
|
|
|
+ assert_equal(response['access_type'], 'rename-source')
|
|
|
+ assert_equal(response['relative_path'], '/user/csso_hueuser/new_dir')
|
|
|
+
|
|
|
|
|
|
def test_get_raz_client_s3(self):
|
|
|
with patch('desktop.lib.raz.raz_client.RazToken') as RazToken:
|