Skip to content

Commit 4b03901

Browse files
committed
fix some unittest
1 parent 592baa1 commit 4b03901

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

v2/options/client_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ func (s *baseTestSuite) assertURLValuesEqual(e, a url.Values) {
6767
r.NotEmpty(a.Get(k))
6868
continue
6969
}
70+
r.Equal(e.Get(k), a.Get(k), k)
7071
}
7172
}
7273

v2/options/order_service_test.go

+6-7
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package options
22

33
import (
44
"encoding/json"
5-
"fmt"
65
"testing"
76

87
"github.com/stretchr/testify/suite"
@@ -245,9 +244,9 @@ func (s *orderServiceTestSuite) TestCreateBatchOrders() {
245244
},
246245
}
247246
s.assertReq(func(r *request) {
248-
packup := [](map[string]string){}
247+
packup := [](map[string]interface{}){}
249248
for _, cos := range orderLists {
250-
t := map[string]string{
249+
t := map[string]interface{}{
251250
"symbol": cos.symbol,
252251
"side": string(cos.side),
253252
"type": string(cos.orderType),
@@ -261,16 +260,16 @@ func (s *orderServiceTestSuite) TestCreateBatchOrders() {
261260
t["timeInForce"] = string(*cos.timeInForce)
262261
}
263262
if cos.reduceOnly != nil {
264-
t["reduceOnly"] = fmt.Sprintf("%v", *cos.reduceOnly)
263+
t["reduceOnly"] = *cos.reduceOnly
265264
}
266265
if cos.postOnly != nil {
267-
t["postOnly"] = fmt.Sprintf("%v", *cos.postOnly)
266+
t["postOnly"] = *cos.postOnly
268267
}
269268
if cos.clientOrderId != nil {
270269
t["clientOrderId"] = *cos.clientOrderId
271270
}
272271
if cos.isMmp != nil {
273-
t["isMmp"] = fmt.Sprintf("%v", *cos.isMmp)
272+
t["isMmp"] = *cos.isMmp
274273
}
275274
packup = append(packup, t)
276275
}
@@ -337,7 +336,7 @@ func (s *orderServiceTestSuite) TestCreateBatchOrders() {
337336
Mmp: false,
338337
},
339338
}
340-
s.assertOrdersEqual(returnOrders, orders)
339+
s.assertOrdersEqual(orders, returnOrders)
341340
}
342341

343342
func (s *orderServiceTestSuite) TestGetOrder() {

0 commit comments

Comments
 (0)