mirror of
https://github.com/astaxie/beego.git
synced 2024-11-26 04:51:30 +00:00
Change set test mode way
This commit is contained in:
parent
245664010c
commit
fa7416452e
6
beego.go
6
beego.go
@ -85,9 +85,11 @@ func initBeforeHTTPRun() {
|
|||||||
|
|
||||||
// TestBeegoInit is for test package init
|
// TestBeegoInit is for test package init
|
||||||
func TestBeegoInit(ap string) {
|
func TestBeegoInit(ap string) {
|
||||||
os.Setenv("BEEGO_RUNMODE", "test")
|
|
||||||
appConfigPath = filepath.Join(ap, "conf", "app.conf")
|
appConfigPath = filepath.Join(ap, "conf", "app.conf")
|
||||||
os.Chdir(ap)
|
os.Chdir(ap)
|
||||||
LoadAppConfig(appConfigProvider, appConfigPath)
|
if err := LoadAppConfig(appConfigProvider, appConfigPath); err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
BConfig.RunMode = "test"
|
||||||
initBeforeHTTPRun()
|
initBeforeHTTPRun()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user