37 lines
1019 B
Go
37 lines
1019 B
Go
package wsc
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"git.rosy.net.cn/baseapi/utils"
|
|
"git.rosy.net.cn/jx-callback/business/jxutils/tasks"
|
|
"git.rosy.net.cn/jx-callback/globals"
|
|
"git.rosy.net.cn/jx-callback/globals/api"
|
|
"git.rosy.net.cn/jx-callback/globals/beegodb"
|
|
"github.com/astaxie/beego"
|
|
)
|
|
|
|
func init() {
|
|
//E:/goprojects/src/git.rosy.net.cn/jx-callback/conf/app.conf
|
|
///Users/xujianhua/go/src/git.rosy.net.cn/jx-callback/conf/app.conf
|
|
beego.InitBeegoBeforeTest("/Users/xujianhua/go/src/git.rosy.net.cn/jx-callback/conf/app.conf")
|
|
beego.BConfig.RunMode = "dev" // InitBeegoBeforeTest会将runmode设置为test
|
|
|
|
globals.Init()
|
|
beegodb.Init()
|
|
api.Init()
|
|
|
|
if err := tasks.RefreshWeimobToken(); err != nil {
|
|
globals.SugarLogger.Errorf("RefreshWeimobToken failed with error:%s", err)
|
|
return
|
|
}
|
|
}
|
|
|
|
func TestGetVendorCategories(t *testing.T) {
|
|
vendorCatList, err := new(PurchaseHandler).GetVendorCategories()
|
|
if err != nil {
|
|
t.Fatal(err.Error())
|
|
}
|
|
globals.SugarLogger.Debug(utils.Format4Output(vendorCatList, false))
|
|
}
|