This commit is contained in:
suyl
2021-07-15 19:04:03 +08:00
parent ee0355d841
commit 6420b5c01e
7 changed files with 271 additions and 29 deletions

View File

@@ -19,10 +19,65 @@ func init() {
api = New("1000", "rfBd56ti2SMtYvSg")
}
func TestUpdatePrinter(t *testing.T) {
err := api.UpdatePrinter("20210615000011", "", "", "", 0)
func TestAddPrinter(t *testing.T) {
err := api.AddPrinter([]*AddPrinterParam{
&AddPrinterParam{
PrintNo: "20210615000012",
Name: "test1",
},
})
if err != nil {
t.Fatalf("PrintMsg return error:%v", err)
}
//baseapi.SugarLogger.Debug(result)
}
func TestDelPrinter(t *testing.T) {
err := api.DelPrinter([]string{"20210615000012"})
if err != nil {
t.Fatalf("PrintMsg return error:%v", err)
}
//baseapi.SugarLogger.Debug(result)
}
func TestUpdatePrinter(t *testing.T) {
err := api.UpdatePrinter(&UpdatePrinterParam{
PrintNo: "20210615000011",
})
if err != nil {
t.Fatalf("PrintMsg return error:%v", err)
}
//baseapi.SugarLogger.Debug(result)
}
func TestDelPrinterSeq(t *testing.T) {
err := api.DelPrinterSeq("20210615000012")
if err != nil {
t.Fatal(err)
}
//t.Log(utils.Format4Output(result, false))
}
func TestGetPrintMsg(t *testing.T) {
result, err := api.GetPrintMsg("20210715104649_F3Z2JXyj")
if err != nil {
t.Fatal(err)
}
t.Log(result)
}
func TestGetPrinterStatus(t *testing.T) {
result, err := api.GetPrinterStatus("20210615000010")
if err != nil {
t.Fatal(err)
}
t.Log(result)
}
func TestDoPrint(t *testing.T) {
result, err := api.DoPrint("20210615000010", "<center>测试一下</center>", 1)
if err != nil {
t.Fatal(err)
}
t.Log(result)
}