mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-10-13 04:32:27 +00: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
|
@ -22,6 +22,7 @@ import (
|
|||
"code.gitea.io/gitea/tests"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestRepoSettingsUnits(t *testing.T) {
|
||||
|
@ -57,12 +58,12 @@ func TestRepoAddMoreUnitsHighlighting(t *testing.T) {
|
|||
setUserHints := func(t *testing.T, hints bool) func() {
|
||||
saved := user.EnableRepoUnitHints
|
||||
|
||||
assert.NoError(t, user_service.UpdateUser(db.DefaultContext, user, &user_service.UpdateOptions{
|
||||
require.NoError(t, user_service.UpdateUser(db.DefaultContext, user, &user_service.UpdateOptions{
|
||||
EnableRepoUnitHints: optional.Some(hints),
|
||||
}))
|
||||
|
||||
return func() {
|
||||
assert.NoError(t, user_service.UpdateUser(db.DefaultContext, user, &user_service.UpdateOptions{
|
||||
require.NoError(t, user_service.UpdateUser(db.DefaultContext, user, &user_service.UpdateOptions{
|
||||
EnableRepoUnitHints: optional.Some(saved),
|
||||
}))
|
||||
}
|
||||
|
@ -172,7 +173,7 @@ func TestRepoAddMoreUnits(t *testing.T) {
|
|||
|
||||
// Disable the Packages unit
|
||||
err := repo_service.UpdateRepositoryUnits(db.DefaultContext, repo, nil, []unit_model.Type{unit_model.TypePackages})
|
||||
assert.NoError(t, err)
|
||||
require.NoError(t, err)
|
||||
|
||||
assertAddMore(t, true)
|
||||
})
|
||||
|
@ -194,7 +195,7 @@ func TestRepoAddMoreUnits(t *testing.T) {
|
|||
|
||||
// Disable the Packages unit
|
||||
err := repo_service.UpdateRepositoryUnits(db.DefaultContext, repo, nil, []unit_model.Type{unit_model.TypePackages})
|
||||
assert.NoError(t, err)
|
||||
require.NoError(t, err)
|
||||
|
||||
// The "Add more" link appears no more
|
||||
assertAddMore(t, false)
|
||||
|
@ -217,7 +218,7 @@ func TestRepoAddMoreUnits(t *testing.T) {
|
|||
|
||||
// Disable the Issues unit
|
||||
err := repo_service.UpdateRepositoryUnits(db.DefaultContext, repo, nil, []unit_model.Type{unit_model.TypeIssues})
|
||||
assert.NoError(t, err)
|
||||
require.NoError(t, err)
|
||||
|
||||
// The "Add more" link appears no more
|
||||
assertAddMore(t, false)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue