Unit tests for wiki routers (#3022)

This commit is contained in:
Ethan Koenig 2017-11-30 07:52:15 -08:00 committed by Lauris BH
parent 82e8486f13
commit 91f3d77ceb
9 changed files with 285 additions and 69 deletions

View file

@ -1,14 +1,8 @@
package models
import (
"fmt"
"os"
"path/filepath"
"testing"
"code.gitea.io/gitea/modules/setting"
_ "github.com/mattn/go-sqlite3" // for the test engine
"github.com/stretchr/testify/assert"
)
@ -19,17 +13,5 @@ func TestFixturesAreConsistent(t *testing.T) {
}
func TestMain(m *testing.M) {
if err := CreateTestEngine("fixtures/"); err != nil {
fmt.Printf("Error creating test engine: %v\n", err)
os.Exit(1)
}
setting.AppURL = "https://try.gitea.io/"
setting.RunUser = "runuser"
setting.SSH.Port = 3000
setting.SSH.Domain = "try.gitea.io"
setting.RepoRootPath = filepath.Join(os.TempDir(), "repos")
setting.AppDataPath = filepath.Join(os.TempDir(), "appdata")
os.Exit(m.Run())
MainTest(m, "..")
}