@@ -321,7 +321,7 @@ func TestUploadFiles_Errors(t *testing.T) {
321321 require .Equal (t , err .Error (), "[PUT /deploys/{deploy_id}/files/{path}][500] uploadDeployFile default &{Code:0 Message:}" )
322322}
323323
324- func TestUploadFiles400Error_SkipsRetry (t * testing.T ) {
324+ func TestUploadFiles422Error_SkipsRetry (t * testing.T ) {
325325 attempts := 0
326326 ctx := gocontext .Background ()
327327
@@ -357,7 +357,7 @@ func TestUploadFiles400Error_SkipsRetry(t *testing.T) {
357357 }
358358 // Set SkipRetry to true
359359 err = client .uploadFiles (ctx , d , files , nil , fileUpload , time .Minute , true )
360- require .Error (t , err )
360+ require .ErrorContains (t , err , "Code:422 Message:Unprocessable Entity" )
361361 require .Equal (t , attempts , 1 )
362362}
363363
@@ -398,7 +398,7 @@ func TestUploadFunctions422Error_SkipsRetry(t *testing.T) {
398398 }
399399 // Set SkipRetry to true
400400 err = client .uploadFiles (apiCtx , d , files , nil , functionUpload , time .Minute , true )
401- require .Error (t , err )
401+ require .ErrorContains (t , err , "Code:422 Message:Unprocessable Entity" )
402402 require .Equal (t , attempts , 1 )
403403}
404404
@@ -412,8 +412,8 @@ func TestUploadFiles400Error_NoSkipRetry(t *testing.T) {
412412 }()
413413
414414 rw .Header ().Set ("Content-Type" , "application/json; charset=utf-8" )
415- rw .WriteHeader (http .StatusUnprocessableEntity )
416- rw .Write ([]byte (`{"message": "Unprocessable Entity ", "code": 400 }` ))
415+ rw .WriteHeader (http .StatusBadRequest )
416+ rw .Write ([]byte (`{"message": "Bad Request ", "code": 400 }` ))
417417 return
418418 }))
419419 defer server .Close ()
@@ -438,8 +438,8 @@ func TestUploadFiles400Error_NoSkipRetry(t *testing.T) {
438438 }
439439 // Set SkipRetry to false
440440 err = client .uploadFiles (ctx , d , files , nil , fileUpload , time .Minute , false )
441- require .Error (t , err )
442- require .Equal (t , attempts , 12 )
441+ require .ErrorContains (t , err , "Code:400 Message:Bad Request" )
442+ require .Greater (t , attempts , 1 )
443443}
444444
445445func TestUploadFiles_SkipEqualFiles (t * testing.T ) {
0 commit comments