Commit 9cafbf6a authored by astaxie's avatar astaxie Committed by GitHub

Merge pull request #2170 from ysqi/develop

Support load app config before test Beego
parents 868e14b8 faba0d72
...@@ -85,8 +85,13 @@ func initBeforeHTTPRun() { ...@@ -85,8 +85,13 @@ func initBeforeHTTPRun() {
// TestBeegoInit is for test package init // TestBeegoInit is for test package init
func TestBeegoInit(ap string) { func TestBeegoInit(ap string) {
appConfigPath = filepath.Join(ap, "conf", "app.conf") path := filepath.Join(ap, "conf", "app.conf")
os.Chdir(ap) os.Chdir(ap)
InitBeegoBeforeTest(path)
}
// InitBeegoBeforeTest is for test package init
func InitBeegoBeforeTest(appConfigPath string) {
if err := LoadAppConfig(appConfigProvider, appConfigPath); err != nil { if err := LoadAppConfig(appConfigProvider, appConfigPath); err != nil {
panic(err) panic(err)
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment