From de0b788303719a3e007cb0161ce01a94df0d10e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Mon, 9 Mar 2020 14:56:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- platformapi/jdeclpapi/jdeclpapi_test.go | 26 ++++++++++++++----------- platformapi/weixinapi/cgibin_test.go | 8 ++++++++ 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/platformapi/jdeclpapi/jdeclpapi_test.go b/platformapi/jdeclpapi/jdeclpapi_test.go index 70af6c5c..64fbb17c 100644 --- a/platformapi/jdeclpapi/jdeclpapi_test.go +++ b/platformapi/jdeclpapi/jdeclpapi_test.go @@ -3,6 +3,8 @@ package jdeclpapi import ( "testing" + "git.rosy.net.cn/baseapi/utils" + "git.rosy.net.cn/baseapi" "go.uber.org/zap" ) @@ -16,15 +18,25 @@ func init() { logger, _ := zap.NewDevelopment() sugarLogger = logger.Sugar() baseapi.Init(sugarLogger) - api = New("", "", "", "") + api = New("7e9c1a5fe4ac4ea48c3c572d488e60b8hnwz", "0D397F05CF11C51BCDCC81744680EBC3", "f16a5e57ff4f4f428b702c40d2d4b933") } func TestQuerySpSource(t *testing.T) { - api.QuerySpSource() + result, err := api.QuerySpSource() + if err != nil { + t.Fatal(err) + } + t.Log(utils.Format4Output(result, false)) } func TestAddOrder(t *testing.T) { - api.AddOrder(&AddOrderParam{}) + result, err := api.AddOrder(&AddOrderParam{ + + }) + if err != nil { + t.Fatal(err) + } + t.Log(utils.Format4Output(result, false)) } func TestCancelOrder(t *testing.T) { api.CancelOrder("") @@ -38,11 +50,3 @@ func TestGetTrackMessagePlusByOrder(t *testing.T) { func TestSearchShopStock(t *testing.T) { api.SearchShopStock(&SearchShopStockParam{}) } - -func TestGetTokenInfo(t *testing.T) { - api.GetTokenInfo() -} - -func TestGetToken(t *testing.T) { - api.GetToken() -} diff --git a/platformapi/weixinapi/cgibin_test.go b/platformapi/weixinapi/cgibin_test.go index bb381f14..d13a8956 100644 --- a/platformapi/weixinapi/cgibin_test.go +++ b/platformapi/weixinapi/cgibin_test.go @@ -50,3 +50,11 @@ func TestCBGetUserInfo(t *testing.T) { } t.Log(utils.Format4Output(userInfo, false)) } + +func TestCBGetTicketInfo(t *testing.T) { + userInfo, err := api.CBGetTicketInfo() + if err != nil { + t.Fatal(err) + } + t.Log(utils.Format4Output(userInfo, false)) +}