mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-31 19:06:18 +01:00 
			
		
		
		
	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:
		| @@ -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) | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user