chore: improve test quality
- Merge tests together. - Remove unecessary usage of `onGiteaRun`. - Make proper use of `unittest`. - Make proper use of `test.MockVariable`. - I have not checked all of the testing files yet.
This commit is contained in:
parent
ab36ab57e4
commit
582ab21bc3
18 changed files with 620 additions and 784 deletions
|
@ -14,6 +14,7 @@ import (
|
|||
"code.gitea.io/gitea/models/unittest"
|
||||
user_model "code.gitea.io/gitea/models/user"
|
||||
"code.gitea.io/gitea/modules/setting"
|
||||
"code.gitea.io/gitea/modules/test"
|
||||
"code.gitea.io/gitea/services/actions"
|
||||
"code.gitea.io/gitea/services/automerge"
|
||||
|
||||
|
@ -23,7 +24,7 @@ import (
|
|||
|
||||
func TestActionsAutomerge(t *testing.T) {
|
||||
onGiteaRun(t, func(t *testing.T, u *url.URL) {
|
||||
assert.True(t, setting.Actions.Enabled, "Actions should be enabled")
|
||||
defer test.MockVariableValue(&setting.Actions.Enabled, true)()
|
||||
|
||||
ctx := db.DefaultContext
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue