Enable tenv and testifylint rules (#32852)
Enables tenv and testifylint linters closes: https://github.com/go-gitea/gitea/issues/32842
This commit is contained in:
parent
df9a78cd04
commit
33e8e82c4b
113 changed files with 272 additions and 282 deletions
|
@ -49,7 +49,7 @@ func TestAPIUserSearchLoggedIn(t *testing.T) {
|
|||
for _, user := range results.Data {
|
||||
assert.Contains(t, user.UserName, query)
|
||||
assert.NotEmpty(t, user.Email)
|
||||
assert.True(t, user.Visibility == "public")
|
||||
assert.Equal(t, "public", user.Visibility)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -83,7 +83,7 @@ func TestAPIUserSearchSystemUsers(t *testing.T) {
|
|||
var results SearchResults
|
||||
DecodeJSON(t, resp, &results)
|
||||
assert.NotEmpty(t, results.Data)
|
||||
if assert.EqualValues(t, 1, len(results.Data)) {
|
||||
if assert.Len(t, results.Data, 1) {
|
||||
user := results.Data[0]
|
||||
assert.EqualValues(t, user.UserName, systemUser.Name)
|
||||
assert.EqualValues(t, user.ID, systemUser.ID)
|
||||
|
@ -137,7 +137,7 @@ func TestAPIUserSearchByEmail(t *testing.T) {
|
|||
|
||||
var results SearchResults
|
||||
DecodeJSON(t, resp, &results)
|
||||
assert.Equal(t, 1, len(results.Data))
|
||||
assert.Len(t, results.Data, 1)
|
||||
assert.Equal(t, query, results.Data[0].Email)
|
||||
|
||||
// no login user can not search user with private email
|
||||
|
@ -155,6 +155,6 @@ func TestAPIUserSearchByEmail(t *testing.T) {
|
|||
resp = MakeRequest(t, req, http.StatusOK)
|
||||
|
||||
DecodeJSON(t, resp, &results)
|
||||
assert.Equal(t, 1, len(results.Data))
|
||||
assert.Len(t, results.Data, 1)
|
||||
assert.Equal(t, query, results.Data[0].Email)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue