mirror of
https://github.com/go-gitea/gitea
synced 2025-07-05 10:07:22 +00:00
Enable addtional linters (#34085)
enable mirror, usestdlibbars and perfsprint part of: https://github.com/go-gitea/gitea/issues/34083 --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
@ -4,7 +4,6 @@
|
||||
package integration
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
"testing"
|
||||
|
||||
@ -63,7 +62,7 @@ func TestAPIUserVariables(t *testing.T) {
|
||||
}
|
||||
|
||||
for _, c := range cases {
|
||||
req := NewRequestWithJSON(t, "POST", fmt.Sprintf("/api/v1/user/actions/variables/%s", c.Name), api.CreateVariableOption{
|
||||
req := NewRequestWithJSON(t, "POST", "/api/v1/user/actions/variables/"+c.Name, api.CreateVariableOption{
|
||||
Value: "value",
|
||||
}).AddTokenAuth(token)
|
||||
MakeRequest(t, req, c.ExpectedStatus)
|
||||
@ -72,7 +71,7 @@ func TestAPIUserVariables(t *testing.T) {
|
||||
|
||||
t.Run("UpdateUserVariable", func(t *testing.T) {
|
||||
variableName := "test_update_var"
|
||||
url := fmt.Sprintf("/api/v1/user/actions/variables/%s", variableName)
|
||||
url := "/api/v1/user/actions/variables/" + variableName
|
||||
req := NewRequestWithJSON(t, "POST", url, api.CreateVariableOption{
|
||||
Value: "initial_val",
|
||||
}).AddTokenAuth(token)
|
||||
@ -118,7 +117,7 @@ func TestAPIUserVariables(t *testing.T) {
|
||||
}
|
||||
|
||||
for _, c := range cases {
|
||||
req := NewRequestWithJSON(t, "PUT", fmt.Sprintf("/api/v1/user/actions/variables/%s", c.Name), api.UpdateVariableOption{
|
||||
req := NewRequestWithJSON(t, "PUT", "/api/v1/user/actions/variables/"+c.Name, api.UpdateVariableOption{
|
||||
Name: c.UpdateName,
|
||||
Value: "updated_val",
|
||||
}).AddTokenAuth(token)
|
||||
@ -128,7 +127,7 @@ func TestAPIUserVariables(t *testing.T) {
|
||||
|
||||
t.Run("DeleteRepoVariable", func(t *testing.T) {
|
||||
variableName := "test_delete_var"
|
||||
url := fmt.Sprintf("/api/v1/user/actions/variables/%s", variableName)
|
||||
url := "/api/v1/user/actions/variables/" + variableName
|
||||
|
||||
req := NewRequestWithJSON(t, "POST", url, api.CreateVariableOption{
|
||||
Value: "initial_val",
|
||||
|
Reference in New Issue
Block a user