- printer test
This commit is contained in:
@@ -7,7 +7,7 @@ import (
|
||||
)
|
||||
|
||||
func TestOrderGet(t *testing.T) {
|
||||
result, err := api.OrderGet("15381031350154")
|
||||
result, err := api.OrderGet("1555731848221773250")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
} else {
|
||||
@@ -23,7 +23,14 @@ func TestOrderCallDelivery(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestOrderSendOut(t *testing.T) {
|
||||
err := api.OrderSendOut("15381031350154", "")
|
||||
err := api.OrderSendOut("1555731848221773250", "")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestOrderComplete(t *testing.T) {
|
||||
err := api.OrderComplete("1555731848221773250", "")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ func init() {
|
||||
}
|
||||
|
||||
func TestPrinterAuth(t *testing.T) {
|
||||
result, err := api.AuthPrinter("7JizmSyiXNzkggaqU", "", "")
|
||||
result, err := api.AuthPrinter("notexist", "", "")
|
||||
if err != nil {
|
||||
t.Fatalf("PrinterAuth return error:%v", err)
|
||||
}
|
||||
@@ -45,7 +45,7 @@ func TestSendMsg(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestGetPrinterStatus(t *testing.T) {
|
||||
runningStae, paperState, err := api.GetPrinterStatus("7JizmSyiXNzkggaqU", "177f213277dd842ba2b53f6c926a48ea")
|
||||
runningStae, paperState, err := api.GetPrinterStatus("notexist", "fc613a8811f963debca940c76b75d162")
|
||||
if err != nil {
|
||||
t.Fatalf("GetPrinterStatus return error:%v", err)
|
||||
}
|
||||
|
||||
@@ -33,3 +33,9 @@ func TestPrintMsg(t *testing.T) {
|
||||
handleError(t, err)
|
||||
baseapi.SugarLogger.Debug(id, status)
|
||||
}
|
||||
|
||||
func TestGetPrinterStatus(t *testing.T) {
|
||||
status, err := api.GetPrinterStatus("deviceid", "devicesecret")
|
||||
handleError(t, err)
|
||||
baseapi.SugarLogger.Debug(status)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user