675643c6 by astaxie

beego: run mode support test

1 parent 4786fb09
......@@ -384,6 +384,7 @@ func initBeforeHttpRun() {
// this function is for test package init
func TestBeegoInit(apppath string) {
AppPath = apppath
RunMode = "test"
AppConfigPath = filepath.Join(AppPath, "conf", "app.conf")
err := ParseConfig()
if err != nil && !os.IsNotExist(err) {
......
......@@ -178,7 +178,11 @@ func ParseConfig() (err error) {
AppConfig = config.NewFakeConfig()
return err
} else {
if v := AppConfig.String(RunMode + "::HttpAddr"); v != "" {
HttpAddr = v
} else {
HttpAddr = AppConfig.String("HttpAddr")
}
if v, err := AppConfig.Int("HttpPort"); err == nil {
HttpPort = v
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!