@@ -394,14 +394,14 @@ class TestListJobArtifacts(TestJobs):
394394
395395 @mock .patch ("gradient.api_sdk.clients.http_client.requests.get" )
396396 def test_should_send_valid_get_request_with_all_parameters_for_a_list_of_artifacts (self , get_patched ):
397- get_patched .return_value = MockResponse ()
397+ get_patched .return_value = MockResponse (LIST_JOB_FILES_RESPONSE_JSON )
398398 job_id = "some_job_id"
399399 result = self .runner .invoke (cli .cli ,
400400 ["jobs" , "artifacts" , "list" , "--id" , job_id , "--apiKey" , "some_key" , "--size" ,
401401 "--links" ,
402402 "--files" , "foo" ])
403403
404- get_patched .assert_called_with ("{}/jobs/artifactsList " .format (self .URL ),
404+ get_patched .assert_called_with ("{}/jobs/artifactsListV2 " .format (self .URL ),
405405 headers = EXPECTED_HEADERS_WITH_CHANGED_API_KEY ,
406406 json = None ,
407407 params = {"jobId" : job_id ,
@@ -412,11 +412,11 @@ def test_should_send_valid_get_request_with_all_parameters_for_a_list_of_artifac
412412
413413 @mock .patch ("gradient.api_sdk.clients.http_client.requests.get" )
414414 def test_should_read_options_from_yaml_file (self , get_patched , jobs_artifacts_list_config_path ):
415- get_patched .return_value = MockResponse ()
415+ get_patched .return_value = MockResponse (LIST_JOB_FILES_RESPONSE_JSON )
416416 command = ["jobs" , "artifacts" , "list" , "--optionsFile" , jobs_artifacts_list_config_path ]
417417 result = self .runner .invoke (cli .cli , command )
418418
419- get_patched .assert_called_with ("{}/jobs/artifactsList " .format (self .URL ),
419+ get_patched .assert_called_with ("{}/jobs/artifactsListV2 " .format (self .URL ),
420420 headers = EXPECTED_HEADERS_WITH_CHANGED_API_KEY ,
421421 json = None ,
422422 params = {"files" : "keton*.py" ,
@@ -434,12 +434,12 @@ def test_should_send_valid_get_request_with_valid_param_for_a_list_of_artifacts_
434434 get_patched ,
435435 option ,
436436 param ):
437- get_patched .return_value = MockResponse (status_code = 200 )
437+ get_patched .return_value = MockResponse (LIST_JOB_FILES_RESPONSE_JSON , status_code = 200 )
438438 job_id = "some_job_id"
439439 result = self .runner .invoke (cli .cli ,
440440 ["jobs" , "artifacts" , "list" , "--id" , job_id , "--apiKey" , "some_key" ] + [option ])
441441
442- get_patched .assert_called_with ("{}/jobs/artifactsList " .format (self .URL ),
442+ get_patched .assert_called_with ("{}/jobs/artifactsListV2 " .format (self .URL ),
443443 headers = EXPECTED_HEADERS_WITH_CHANGED_API_KEY ,
444444 json = None ,
445445 params = {"jobId" : job_id ,
@@ -635,7 +635,7 @@ def test_should_send_proper_data_and_tag_job(self, post_patched, get_patched, pu
635635
636636class TestDownloadJobArtifacts (TestJobs ):
637637 runner = CliRunner ()
638- LIST_FILES_URL = "https://api.paperspace.io/jobs/artifactsList "
638+ LIST_FILES_URL = "https://api.paperspace.io/jobs/artifactsListV2 "
639639 DESTINATION_DIR_NAME = "dest"
640640 DESTINATION_DIR_PATH = os .path .join (tempfile .gettempdir (), "dest" )
641641
0 commit comments