forked from kevadesu/forgejo
format with gofumpt (#18184)
* gofumpt -w -l . * gofumpt -w -l -extra . * Add linter * manual fix * change make fmt
This commit is contained in:
parent
1d98d205f5
commit
54e9ee37a7
423 changed files with 1585 additions and 1758 deletions
|
@ -53,21 +53,21 @@ func TestAPIModifyLabels(t *testing.T) {
|
|||
})
|
||||
session.MakeRequest(t, req, http.StatusUnprocessableEntity)
|
||||
|
||||
//ListLabels
|
||||
// ListLabels
|
||||
req = NewRequest(t, "GET", urlStr)
|
||||
resp = session.MakeRequest(t, req, http.StatusOK)
|
||||
var apiLabels []*api.Label
|
||||
DecodeJSON(t, resp, &apiLabels)
|
||||
assert.Len(t, apiLabels, 2)
|
||||
|
||||
//GetLabel
|
||||
// GetLabel
|
||||
singleURLStr := fmt.Sprintf("/api/v1/repos/%s/%s/labels/%d?token=%s", owner.Name, repo.Name, dbLabel.ID, token)
|
||||
req = NewRequest(t, "GET", singleURLStr)
|
||||
resp = session.MakeRequest(t, req, http.StatusOK)
|
||||
DecodeJSON(t, resp, &apiLabel)
|
||||
assert.EqualValues(t, strings.TrimLeft(dbLabel.Color, "#"), apiLabel.Color)
|
||||
|
||||
//EditLabel
|
||||
// EditLabel
|
||||
newName := "LabelNewName"
|
||||
newColor := "09876a"
|
||||
newColorWrong := "09g76a"
|
||||
|
@ -83,10 +83,9 @@ func TestAPIModifyLabels(t *testing.T) {
|
|||
})
|
||||
session.MakeRequest(t, req, http.StatusUnprocessableEntity)
|
||||
|
||||
//DeleteLabel
|
||||
// DeleteLabel
|
||||
req = NewRequest(t, "DELETE", singleURLStr)
|
||||
session.MakeRequest(t, req, http.StatusNoContent)
|
||||
|
||||
}
|
||||
|
||||
func TestAPIAddIssueLabels(t *testing.T) {
|
||||
|
@ -173,21 +172,21 @@ func TestAPIModifyOrgLabels(t *testing.T) {
|
|||
})
|
||||
session.MakeRequest(t, req, http.StatusUnprocessableEntity)
|
||||
|
||||
//ListLabels
|
||||
// ListLabels
|
||||
req = NewRequest(t, "GET", urlStr)
|
||||
resp = session.MakeRequest(t, req, http.StatusOK)
|
||||
var apiLabels []*api.Label
|
||||
DecodeJSON(t, resp, &apiLabels)
|
||||
assert.Len(t, apiLabels, 4)
|
||||
|
||||
//GetLabel
|
||||
// GetLabel
|
||||
singleURLStr := fmt.Sprintf("/api/v1/orgs/%s/labels/%d?token=%s", owner.Name, dbLabel.ID, token)
|
||||
req = NewRequest(t, "GET", singleURLStr)
|
||||
resp = session.MakeRequest(t, req, http.StatusOK)
|
||||
DecodeJSON(t, resp, &apiLabel)
|
||||
assert.EqualValues(t, strings.TrimLeft(dbLabel.Color, "#"), apiLabel.Color)
|
||||
|
||||
//EditLabel
|
||||
// EditLabel
|
||||
newName := "LabelNewName"
|
||||
newColor := "09876a"
|
||||
newColorWrong := "09g76a"
|
||||
|
@ -203,8 +202,7 @@ func TestAPIModifyOrgLabels(t *testing.T) {
|
|||
})
|
||||
session.MakeRequest(t, req, http.StatusUnprocessableEntity)
|
||||
|
||||
//DeleteLabel
|
||||
// DeleteLabel
|
||||
req = NewRequest(t, "DELETE", singleURLStr)
|
||||
session.MakeRequest(t, req, http.StatusNoContent)
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue