Skip to content

Commit 1635f71

Browse files
committed
fix formatting
1 parent e0bdca6 commit 1635f71

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

restapi/user_objects_test.go

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,16 @@ import (
2121
"encoding/json"
2222
"errors"
2323
"fmt"
24-
"github.com/go-openapi/runtime/middleware"
25-
"github.com/minio/console/restapi/operations/object"
2624
"io"
2725
"net/http"
2826
"path/filepath"
2927
"reflect"
3028
"testing"
3129
"time"
3230

31+
"github.com/go-openapi/runtime/middleware"
32+
"github.com/minio/console/restapi/operations/object"
33+
3334
"github.com/go-openapi/swag"
3435
"github.com/minio/console/models"
3536
mc "github.com/minio/mc/cmd"
@@ -908,7 +909,7 @@ func Test_deleteObjects(t *testing.T) {
908909
}
909910

910911
func Test_shareObject(t *testing.T) {
911-
assert := assert.New(t)
912+
tAssert := assert.New(t)
912913
ctx, cancel := context.WithCancel(context.Background())
913914
defer cancel()
914915
client := s3ClientMock{}
@@ -981,7 +982,7 @@ func Test_shareObject(t *testing.T) {
981982
return
982983
}
983984
} else {
984-
assert.Equal(*url, tt.expected)
985+
tAssert.Equal(*url, tt.expected)
985986
}
986987
})
987988
}
@@ -1057,7 +1058,7 @@ func Test_putObjectLegalHold(t *testing.T) {
10571058
}
10581059

10591060
func Test_putObjectRetention(t *testing.T) {
1060-
assert := assert.New(t)
1061+
tAssert := assert.New(t)
10611062
ctx, cancel := context.WithCancel(context.Background())
10621063
defer cancel()
10631064
client := minioClientMock{}
@@ -1179,16 +1180,16 @@ func Test_putObjectRetention(t *testing.T) {
11791180
err := setObjectRetention(ctx, client, tt.args.bucket, tt.args.prefix, tt.args.versionID, tt.args.opts)
11801181
if tt.wantError != nil {
11811182
fmt.Println(t.Name())
1182-
assert.Equal(tt.wantError.Error(), err.Error(), fmt.Sprintf("setObjectRetention() error: `%s`, wantErr: `%s`", err, tt.wantError))
1183+
tAssert.Equal(tt.wantError.Error(), err.Error(), fmt.Sprintf("setObjectRetention() error: `%s`, wantErr: `%s`", err, tt.wantError))
11831184
} else {
1184-
assert.Nil(err, fmt.Sprintf("setObjectRetention() error: %v, wantErr: %v", err, tt.wantError))
1185+
tAssert.Nil(err, fmt.Sprintf("setObjectRetention() error: %v, wantErr: %v", err, tt.wantError))
11851186
}
11861187
})
11871188
}
11881189
}
11891190

11901191
func Test_deleteObjectRetention(t *testing.T) {
1191-
assert := assert.New(t)
1192+
tAssert := assert.New(t)
11921193
ctx, cancel := context.WithCancel(context.Background())
11931194
defer cancel()
11941195
client := minioClientMock{}
@@ -1222,16 +1223,16 @@ func Test_deleteObjectRetention(t *testing.T) {
12221223
err := deleteObjectRetention(ctx, client, tt.args.bucket, tt.args.prefix, tt.args.versionID)
12231224
if tt.wantError != nil {
12241225
fmt.Println(t.Name())
1225-
assert.Equal(tt.wantError.Error(), err.Error(), fmt.Sprintf("deleteObjectRetention() error: `%s`, wantErr: `%s`", err, tt.wantError))
1226+
tAssert.Equal(tt.wantError.Error(), err.Error(), fmt.Sprintf("deleteObjectRetention() error: `%s`, wantErr: `%s`", err, tt.wantError))
12261227
} else {
1227-
assert.Nil(err, fmt.Sprintf("deleteObjectRetention() error: %v, wantErr: %v", err, tt.wantError))
1228+
tAssert.Nil(err, fmt.Sprintf("deleteObjectRetention() error: %v, wantErr: %v", err, tt.wantError))
12281229
}
12291230
})
12301231
}
12311232
}
12321233

12331234
func Test_getObjectInfo(t *testing.T) {
1234-
assert := assert.New(t)
1235+
tAssert := assert.New(t)
12351236
ctx, cancel := context.WithCancel(context.Background())
12361237
defer cancel()
12371238
client := minioClientMock{}
@@ -1275,9 +1276,9 @@ func Test_getObjectInfo(t *testing.T) {
12751276
_, err := getObjectInfo(ctx, client, tt.args.bucketName, tt.args.prefix)
12761277
if tt.wantError != nil {
12771278
fmt.Println(t.Name())
1278-
assert.Equal(tt.wantError.Error(), err.Error(), fmt.Sprintf("getObjectInfo() error: `%s`, wantErr: `%s`", err, tt.wantError))
1279+
tAssert.Equal(tt.wantError.Error(), err.Error(), fmt.Sprintf("getObjectInfo() error: `%s`, wantErr: `%s`", err, tt.wantError))
12791280
} else {
1280-
assert.Nil(err, fmt.Sprintf("getObjectInfo() error: %v, wantErr: %v", err, tt.wantError))
1281+
tAssert.Nil(err, fmt.Sprintf("getObjectInfo() error: %v, wantErr: %v", err, tt.wantError))
12811282
}
12821283
})
12831284
}
@@ -1487,7 +1488,7 @@ func Test_getMultipleFilesDownloadResponse(t *testing.T) {
14871488
t.Run(tt.name, func(t *testing.T) {
14881489
got, got1 := getMultipleFilesDownloadResponse(tt.args.session, tt.args.params)
14891490
assert.Equal(t, tt.want1, got1)
1490-
assert.NotNil(t, got) //responder func
1491+
assert.NotNil(t, got)
14911492
})
14921493
}
14931494
}

0 commit comments

Comments
 (0)