From 4b03901e5b554f62afbcc42e3fccf12538fe8519 Mon Sep 17 00:00:00 2001 From: xieyongqi <657023321@qq.com> Date: Sun, 9 Jun 2024 12:23:50 +0800 Subject: [PATCH] fix some unittest --- v2/options/client_test.go | 1 + v2/options/order_service_test.go | 13 ++++++------- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/v2/options/client_test.go b/v2/options/client_test.go index 8067a137..f9711cfc 100644 --- a/v2/options/client_test.go +++ b/v2/options/client_test.go @@ -67,6 +67,7 @@ func (s *baseTestSuite) assertURLValuesEqual(e, a url.Values) { r.NotEmpty(a.Get(k)) continue } + r.Equal(e.Get(k), a.Get(k), k) } } diff --git a/v2/options/order_service_test.go b/v2/options/order_service_test.go index 232ba47b..3ca6614c 100644 --- a/v2/options/order_service_test.go +++ b/v2/options/order_service_test.go @@ -2,7 +2,6 @@ package options import ( "encoding/json" - "fmt" "testing" "github.com/stretchr/testify/suite" @@ -245,9 +244,9 @@ func (s *orderServiceTestSuite) TestCreateBatchOrders() { }, } s.assertReq(func(r *request) { - packup := [](map[string]string){} + packup := [](map[string]interface{}){} for _, cos := range orderLists { - t := map[string]string{ + t := map[string]interface{}{ "symbol": cos.symbol, "side": string(cos.side), "type": string(cos.orderType), @@ -261,16 +260,16 @@ func (s *orderServiceTestSuite) TestCreateBatchOrders() { t["timeInForce"] = string(*cos.timeInForce) } if cos.reduceOnly != nil { - t["reduceOnly"] = fmt.Sprintf("%v", *cos.reduceOnly) + t["reduceOnly"] = *cos.reduceOnly } if cos.postOnly != nil { - t["postOnly"] = fmt.Sprintf("%v", *cos.postOnly) + t["postOnly"] = *cos.postOnly } if cos.clientOrderId != nil { t["clientOrderId"] = *cos.clientOrderId } if cos.isMmp != nil { - t["isMmp"] = fmt.Sprintf("%v", *cos.isMmp) + t["isMmp"] = *cos.isMmp } packup = append(packup, t) } @@ -337,7 +336,7 @@ func (s *orderServiceTestSuite) TestCreateBatchOrders() { Mmp: false, }, } - s.assertOrdersEqual(returnOrders, orders) + s.assertOrdersEqual(orders, returnOrders) } func (s *orderServiceTestSuite) TestGetOrder() {