Skip to content

Commit 91f4193

Browse files
committed
Fix compliance
1 parent 18811c7 commit 91f4193

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/integration/api_repo_files_get_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ func testAPIGetRequestedFiles(t *testing.T, u *url.URL) {
155155
resp = MakeRequest(t, req, http.StatusOK)
156156
DecodeJSON(t, resp, &contentsListResponse)
157157
assert.NotNil(t, contentsListResponse)
158-
assert.Equal(t, setting.API.DefaultPagingNum, len(contentsListResponse))
158+
assert.Len(t, contentsListResponse, setting.API.DefaultPagingNum)
159159

160160
// create new repo for large file tests
161161
baseRepo, err := repo_service.CreateRepository(db.DefaultContext, user2, user2, repo_service.CreateRepoOptions{
@@ -202,7 +202,7 @@ func testAPIGetRequestedFiles(t *testing.T, u *url.URL) {
202202
DecodeJSON(t, resp, &contentsListResponse)
203203
assert.NotNil(t, contentsListResponse)
204204
assert.Equal(t, int64(15728640), contentsListResponse[0].Size)
205-
assert.Equal(t, "", *contentsListResponse[0].Content)
205+
assert.Empty(t, *contentsListResponse[0].Content)
206206

207207
// Test response size limit
208208
smallFile := make([]byte, 5242880) // 5 MiB -> under max blob size
@@ -235,5 +235,5 @@ func testAPIGetRequestedFiles(t *testing.T, u *url.URL) {
235235
resp = MakeRequest(t, req, http.StatusOK)
236236
DecodeJSON(t, resp, &contentsListResponse)
237237
assert.NotNil(t, contentsListResponse)
238-
assert.Equal(t, 20, len(contentsListResponse))
238+
assert.Len(t, contentsListResponse, 20)
239239
}

0 commit comments

Comments
 (0)