package yilianyun

import (
	"testing"

	"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"

	_ "git.rosy.net.cn/jx-callback/business/jxcallback/orderman"
	_ "git.rosy.net.cn/jx-callback/business/jxcallback/scheduler/defsch"
	"git.rosy.net.cn/jx-callback/globals/api"
	"git.rosy.net.cn/jx-callback/globals/testinit"
)

func init() {
	testinit.Init()
	api.YilianyunAPI.SetToken("8d54951744984b7a8908251c3063b445")
}

func TestPrintMsg(t *testing.T) {
	//orderID := "910838879000442"
	//vendorID := 0
	//order, err := partner.CurOrderManager.LoadOrder(orderID, vendorID)
	//if err != nil {
	//	t.Fatal(err)
	//}
	//
	//// context := CurPrinterHandler.getOrderContent(order, "13412345678")
	//context := CurPrinterHandler.getOrderContentBig(order, "13412345678")
	//status, err := CurPrinterHandler.PrintMsg(jxcontext.AdminCtx, "4004600675", "fem2ukwvduik", "test", context)
	//t.Log(utils.Format4Output(status, false))
	//if err != nil {
	//	t.Fatal(err)
	//}
}

func TestRegisterPrinter(t *testing.T) {
	newID1, newID2, err := CurPrinterHandler.RegisterPrinter(jxcontext.AdminCtx, "4004600675", "fem2ukwvduik", "title")
	t.Log(newID1 + "," + newID2)
	if err != nil {
		t.Fatal(err)
	}
}
