1
0
mirror of https://github.com/astaxie/beego.git synced 2024-12-23 03:40:49 +00:00

Change set test mode way

This commit is contained in:
ysqi 2016-04-27 22:26:32 +08:00
parent 245664010c
commit fa7416452e

View File

@ -85,9 +85,11 @@ func initBeforeHTTPRun() {
// TestBeegoInit is for test package init
func TestBeegoInit(ap string) {
os.Setenv("BEEGO_RUNMODE", "test")
appConfigPath = filepath.Join(ap, "conf", "app.conf")
os.Chdir(ap)
LoadAppConfig(appConfigProvider, appConfigPath)
if err := LoadAppConfig(appConfigProvider, appConfigPath); err != nil {
panic(err)
}
BConfig.RunMode = "test"
initBeforeHTTPRun()
}