Change set test mode way

This commit is contained in:
ysqi 2016-04-27 22:26:32 +08:00
parent 245664010c
commit fa7416452e
1 changed files with 4 additions and 2 deletions

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()
}