From 0e342ff4c1cc19c31ed42c4ba4bd08a31615183e Mon Sep 17 00:00:00 2001 From: Jeffrey Wu Date: Fri, 23 Nov 2018 16:17:11 +0800 Subject: [PATCH] update the default test file `tests/default_test.go` --- cmd/commands/api/apiapp.go | 6 +++--- cmd/commands/new/new.go | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cmd/commands/api/apiapp.go b/cmd/commands/api/apiapp.go index e1862be..bf10768 100644 --- a/cmd/commands/api/apiapp.go +++ b/cmd/commands/api/apiapp.go @@ -511,9 +511,9 @@ import ( ) func init() { - _, file, _, _ := runtime.Caller(1) - apppath, _ := filepath.Abs(filepath.Dir(filepath.Join(file, ".." + string(filepath.Separator)))) - beego.TestBeegoInit(apppath) + appPath, _ := filepath.Abs("..") + beego.TestBeegoInit(appPath) + beego.AppPath = appPath } // TestGet is a sample to run an endpoint test diff --git a/cmd/commands/new/new.go b/cmd/commands/new/new.go index 299f094..ef6d34c 100644 --- a/cmd/commands/new/new.go +++ b/cmd/commands/new/new.go @@ -101,9 +101,9 @@ import ( ) func init() { - _, file, _, _ := runtime.Caller(1) - apppath, _ := filepath.Abs(filepath.Dir(filepath.Join(file, ".." + string(filepath.Separator)))) - beego.TestBeegoInit(apppath) + appPath, _ := filepath.Abs("..") + beego.TestBeegoInit(appPath) + beego.AppPath = appPath }