1
0
Fork 0
forked from forgejo/forgejo

[TESTS] testMiddlewareHook, dependency injection in integration tests

(cherry picked from commit 6623630d10)
(cherry picked from commit 5e30a4f950)
(cherry picked from commit 355a117e74)
(cherry picked from commit 2e98ceccbc)
(cherry picked from commit e1687f1e20)
This commit is contained in:
Earl Warren 2023-06-05 11:04:47 +02:00
parent cf7c08031f
commit 2b97800dd8
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00
6 changed files with 32 additions and 18 deletions

View file

@ -4,24 +4,22 @@
package integration
import (
"context"
"net/http"
"net/url"
"testing"
"code.gitea.io/gitea/modules/setting"
api "code.gitea.io/gitea/modules/structs"
"code.gitea.io/gitea/routers"
"github.com/stretchr/testify/assert"
)
func TestNodeinfo(t *testing.T) {
setting.Federation.Enabled = true
c = routers.NormalRoutes(context.TODO())
setNormalRoutes()
defer func() {
setting.Federation.Enabled = false
c = routers.NormalRoutes(context.TODO())
setNormalRoutes()
}()
onGiteaRun(t, func(*testing.T, *url.URL) {