@@ -265,26 +265,38 @@ class TestJobArtifactsCommands(TestJobs):
265265 @mock .patch ("paperspace.client.requests.post" )
266266 def test_should_send_valid_post_request_when_destroying_artifacts_with_files_specified (self , post_patched ):
267267 post_patched .return_value = MockResponse (status_code = 200 )
268- job_id = ' some_job_id'
269- file_names = ' some_file_names'
270- result = self .runner .invoke (cli .cli , [' jobs' , 'artifactsDestroy' , job_id , ' --files' , file_names , "--apiKey" , "some_key" ])
268+ job_id = " some_job_id"
269+ file_names = " some_file_names"
270+ result = self .runner .invoke (cli .cli , [" jobs" , "artifacts" , "destroy" , job_id , " --files" , file_names , "--apiKey" , "some_key" ])
271271
272- post_patched .assert_called_with (' {}/jobs/{}/artifactsDestroy' .format (self .URL , job_id ),
272+ post_patched .assert_called_with (" {}/jobs/{}/artifactsDestroy" .format (self .URL , job_id ),
273273 files = None ,
274274 headers = self .EXPECTED_HEADERS_WITH_CHANGED_API_KEY ,
275275 json = None ,
276- params = {' files' : file_names })
276+ params = {" files" : file_names })
277277 assert result .exit_code == 0
278278
279279 @mock .patch ("paperspace.client.requests.post" )
280280 def test_should_send_valid_post_request_when_destroying_artifacts_without_files_specified (self , post_patched ):
281281 post_patched .return_value = MockResponse (status_code = 200 )
282- job_id = ' some_job_id'
283- result = self .runner .invoke (cli .cli , [' jobs' , 'artifactsDestroy' , job_id , "--apiKey" , "some_key" ])
282+ job_id = " some_job_id"
283+ result = self .runner .invoke (cli .cli , [" jobs" , "artifacts" , "destroy" , job_id , "--apiKey" , "some_key" ])
284284
285- post_patched .assert_called_with (' {}/jobs/{}/artifactsDestroy' .format (self .URL , job_id ),
285+ post_patched .assert_called_with (" {}/jobs/{}/artifactsDestroy" .format (self .URL , job_id ),
286286 files = None ,
287287 headers = self .EXPECTED_HEADERS_WITH_CHANGED_API_KEY ,
288288 json = None ,
289289 params = None )
290290 assert result .exit_code == 0
291+
292+ @mock .patch ("paperspace.client.requests.get" )
293+ def test_should_send_send_valid_get_request_and_receive_json_response (self , get_patched ):
294+ get_patched .return_value = MockResponse (status_code = 200 )
295+ job_id = "some_job_id"
296+ result = self .runner .invoke (cli .cli , ["jobs" , "artifacts" , "get" , job_id , "--apiKey" , "some_key" ])
297+
298+ get_patched .assert_called_with ("{}/jobs/artifactsGet" .format (self .URL ),
299+ headers = self .EXPECTED_HEADERS_WITH_CHANGED_API_KEY ,
300+ json = None ,
301+ params = {"jobId" : job_id })
302+ assert result .exit_code == 0
0 commit comments