Skip to content

Commit

Permalink
fix some unittest
Browse files Browse the repository at this point in the history
  • Loading branch information
xyq-c-cpp committed Jun 9, 2024
1 parent 592baa1 commit 4b03901
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
1 change: 1 addition & 0 deletions v2/options/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

Expand Down
13 changes: 6 additions & 7 deletions v2/options/order_service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package options

import (
"encoding/json"
"fmt"
"testing"

"github.com/stretchr/testify/suite"
Expand Down Expand Up @@ -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),
Expand All @@ -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)
}
Expand Down Expand Up @@ -337,7 +336,7 @@ func (s *orderServiceTestSuite) TestCreateBatchOrders() {
Mmp: false,
},
}
s.assertOrdersEqual(returnOrders, orders)
s.assertOrdersEqual(orders, returnOrders)
}

func (s *orderServiceTestSuite) TestGetOrder() {
Expand Down

0 comments on commit 4b03901

Please sign in to comment.