package txcloudapi

import (
	"testing"

	"git.rosy.net.cn/baseapi"
	"git.rosy.net.cn/baseapi/utils"
	"go.uber.org/zap"
)

var (
	api         *API
	sugarLogger *zap.SugaredLogger
)

func init() {
	logger, _ := zap.NewDevelopment()
	sugarLogger = logger.Sugar()
	baseapi.Init(sugarLogger)
	api = New("AKIDFNmm1U7vhITlVItry0ng5Q268lGjDZyQUR6", "25p3aynr97hOMJEfpvr0LoXD0gI62l7wcHA7nsM6")
}

func TestGetWaybillDetailInfo(t *testing.T) {
	result, err := api.GetWaybillDetailInfo("4606698717581", "")
	if err != nil {
		t.Fatal(err)
	}
	t.Log(utils.Format4Output(result, false))
}

func TestAddressDistinguish(t *testing.T) {
	result, err := api.AddressDistinguish("班地亚13360506016六约六和路1号11-101文友彩印A栋301广东省深圳市龙岗区横岗街道横岗")
	if err != nil {
		t.Fatal(err)
	}
	t.Log(utils.Format4Output(result, false))
}
