mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-06-01 05:01:47 +02:00
enable linter testifylint on v7 (#4572)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/4572 Co-authored-by: TheFox0x7 <thefox0x7@gmail.com> Co-committed-by: TheFox0x7 <thefox0x7@gmail.com>
This commit is contained in:
parent
c47bdf436b
commit
072dd9f8bc
494 changed files with 4897 additions and 4554 deletions
|
@ -23,6 +23,7 @@ import (
|
|||
"code.gitea.io/gitea/services/forms"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
type APITestContext struct {
|
||||
|
@ -168,7 +169,7 @@ func doAPIDeleteRepository(ctx APITestContext) func(*testing.T) {
|
|||
func doAPICreateUserKey(ctx APITestContext, keyname, keyFile string, callback ...func(*testing.T, api.PublicKey)) func(*testing.T) {
|
||||
return func(t *testing.T) {
|
||||
dataPubKey, err := os.ReadFile(keyFile + ".pub")
|
||||
assert.NoError(t, err)
|
||||
require.NoError(t, err)
|
||||
req := NewRequestWithJSON(t, "POST", "/api/v1/user/keys", &api.CreateKeyOption{
|
||||
Title: keyname,
|
||||
Key: string(dataPubKey),
|
||||
|
@ -201,7 +202,7 @@ func doAPIDeleteUserKey(ctx APITestContext, keyID int64) func(*testing.T) {
|
|||
func doAPICreateDeployKey(ctx APITestContext, keyname, keyFile string, readOnly bool) func(*testing.T) {
|
||||
return func(t *testing.T) {
|
||||
dataPubKey, err := os.ReadFile(keyFile + ".pub")
|
||||
assert.NoError(t, err)
|
||||
require.NoError(t, err)
|
||||
req := NewRequestWithJSON(t, "POST", fmt.Sprintf("/api/v1/repos/%s/%s/keys", ctx.Username, ctx.Reponame), api.CreateKeyOption{
|
||||
Title: keyname,
|
||||
Key: string(dataPubKey),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue