@@ -332,7 +332,7 @@ func TestUploadFiles400Errors(t *testing.T) {
332
332
tr := apiClient .NewWithClient (hu .Host , "/api/v1" , []string {"http" }, http .DefaultClient )
333
333
client := NewRetryable (tr , strfmt .Default , 1 )
334
334
client .uploadLimit = 1
335
- ctx = context .WithAuthInfo (ctx , apiClient .BearerToken ("token " ))
335
+ ctx = context .WithAuthInfo (ctx , apiClient .BearerToken ("bad " ))
336
336
337
337
// Create some files to deploy
338
338
dir , err := ioutil .TempDir ("" , "deploy" )
@@ -343,8 +343,11 @@ func TestUploadFiles400Errors(t *testing.T) {
343
343
files , err := walk (dir , nil , false , false )
344
344
require .NoError (t , err )
345
345
d := & models.Deploy {}
346
+ for _ , bundle := range files .Files {
347
+ d .Required = append (d .Required , bundle .Sum )
348
+ }
346
349
err = client .uploadFiles (ctx , d , files , nil , fileUpload , time .Minute , true )
347
- require .Equal (t , err .Error (), "[PUT /deploys/{deploy_id}/files/{path}][422 ] uploadDeployFile default &{Code:422 Message:}" )
350
+ require .Equal (t , err .Error (), "[PUT /deploys/{deploy_id}/files/{path}][401 ] uploadDeployFile default &{Code:401 Message: Unauthorized }" )
348
351
}
349
352
350
353
func TestUploadFiles_SkipEqualFiles (t * testing.T ) {
0 commit comments