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:
TheFox0x7 2024-07-30 19:42:06 +00:00 committed by Earl Warren
parent c47bdf436b
commit 072dd9f8bc
494 changed files with 4897 additions and 4554 deletions

View file

@ -10,6 +10,7 @@ import (
"code.gitea.io/gitea/modules/json"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
// LoginSource represents an external way for authorizing users.
@ -45,7 +46,7 @@ func Test_UnwrapLDAPSourceCfg(t *testing.T) {
// Run the migration
if err := UnwrapLDAPSourceCfg(x); err != nil {
assert.NoError(t, err)
require.NoError(t, err)
return
}
@ -53,7 +54,7 @@ func Test_UnwrapLDAPSourceCfg(t *testing.T) {
for start := 0; ; start += batchSize {
sources := make([]*LoginSource, 0, batchSize)
if err := x.Table("login_source").Limit(batchSize, start).Find(&sources); err != nil {
assert.NoError(t, err)
require.NoError(t, err)
return
}
@ -66,12 +67,12 @@ func Test_UnwrapLDAPSourceCfg(t *testing.T) {
expected := map[string]any{}
if err := json.Unmarshal([]byte(source.Cfg), &converted); err != nil {
assert.NoError(t, err)
require.NoError(t, err)
return
}
if err := json.Unmarshal([]byte(source.Expected), &expected); err != nil {
assert.NoError(t, err)
require.NoError(t, err)
return
}