mirror of
https://github.com/astaxie/beego.git
synced 2024-11-22 19:10:54 +00:00
Support load app config before test Beego
This commit is contained in:
parent
c3116d3601
commit
faba0d7273
7
beego.go
7
beego.go
@ -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)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user