@@ -281,6 +281,86 @@ def test_copy_folder_succeeds(self):
281281 )
282282 self .assertEqual (request_body , responses .calls [0 ].request .body )
283283
284+ @responses .activate
285+ def test_copy_folder_succeeds_with_include_file_versions_false (self ):
286+ """
287+ Tests if Copy folder succeeds
288+ """
289+ URL .API_BASE_URL = "http://test.com"
290+ url = "{}/v1/bulkJobs/copyFolder" .format (URL .API_BASE_URL )
291+ responses .add (
292+ responses .POST ,
293+ url ,
294+ body = '{"jobId": "62de84fb1b02a58936cc740c"}' ,
295+ )
296+ resp = self .client .copy_folder (
297+ options = CopyFolderRequestOptions (
298+ source_folder_path = "/test" ,
299+ destination_path = "/test1" ,
300+ include_file_versions = False ,
301+ )
302+ )
303+ mock_response_metadata = {
304+ "headers" : {"Content-Type" : "text/plain" },
305+ "httpStatusCode" : 200 ,
306+ "raw" : {"jobId" : "62de84fb1b02a58936cc740c" },
307+ }
308+ request_body = make_string_to_single_line (
309+ """{
310+ "sourceFolderPath": "/test",
311+ "destinationPath": "/test1",
312+ "includeFileVersions": false
313+ }"""
314+ )
315+ self .assertEqual ("62de84fb1b02a58936cc740c" , resp .job_id )
316+ self .assertEqual (
317+ camel_dict_to_snake_dict (mock_response_metadata ),
318+ resp .response_metadata .__dict__ ,
319+ )
320+ self .assertEqual (
321+ "http://test.com/v1/bulkJobs/copyFolder" , responses .calls [0 ].request .url
322+ )
323+ self .assertEqual (request_body , responses .calls [0 ].request .body )
324+
325+ @responses .activate
326+ def test_copy_folder_succeeds_without_include_file_versions (self ):
327+ """
328+ Tests if Copy folder succeeds
329+ """
330+ URL .API_BASE_URL = "http://test.com"
331+ url = "{}/v1/bulkJobs/copyFolder" .format (URL .API_BASE_URL )
332+ responses .add (
333+ responses .POST ,
334+ url ,
335+ body = '{"jobId": "62de84fb1b02a58936cc740c"}' ,
336+ )
337+ resp = self .client .copy_folder (
338+ options = CopyFolderRequestOptions (
339+ source_folder_path = "/test" ,
340+ destination_path = "/test1" ,
341+ )
342+ )
343+ mock_response_metadata = {
344+ "headers" : {"Content-Type" : "text/plain" },
345+ "httpStatusCode" : 200 ,
346+ "raw" : {"jobId" : "62de84fb1b02a58936cc740c" },
347+ }
348+ request_body = make_string_to_single_line (
349+ """{
350+ "sourceFolderPath": "/test",
351+ "destinationPath": "/test1"
352+ }"""
353+ )
354+ self .assertEqual ("62de84fb1b02a58936cc740c" , resp .job_id )
355+ self .assertEqual (
356+ camel_dict_to_snake_dict (mock_response_metadata ),
357+ resp .response_metadata .__dict__ ,
358+ )
359+ self .assertEqual (
360+ "http://test.com/v1/bulkJobs/copyFolder" , responses .calls [0 ].request .url
361+ )
362+ self .assertEqual (request_body , responses .calls [0 ].request .body )
363+
284364
285365class TestMoveFolder (ClientTestCase ):
286366 """
0 commit comments