Merge pull request #2170 from ysqi/develop

Support load app config before test Beego
This commit is contained in:
astaxie 2016-09-19 20:55:20 +08:00 committed by GitHub
commit 9cafbf6a21
1 changed files with 6 additions and 1 deletions

View File

@ -85,8 +85,13 @@ func initBeforeHTTPRun() {
// TestBeegoInit is for test package init
func TestBeegoInit(ap string) {
appConfigPath = filepath.Join(ap, "conf", "app.conf")
path := filepath.Join(ap, "conf", "app.conf")
os.Chdir(ap)
InitBeegoBeforeTest(path)
}
// InitBeegoBeforeTest is for test package init
func InitBeegoBeforeTest(appConfigPath string) {
if err := LoadAppConfig(appConfigProvider, appConfigPath); err != nil {
panic(err)
}