diff --git a/exchanges/huobi/huobi_test.go b/exchanges/huobi/huobi_test.go index a7081a28..e53fcd3d 100644 --- a/exchanges/huobi/huobi_test.go +++ b/exchanges/huobi/huobi_test.go @@ -21,6 +21,7 @@ const ( apiKey = "" apiSecret = "" canManipulateRealOrders = false + testSymbol = "btcusdt" ) var h HUOBI @@ -75,7 +76,7 @@ func TestSetup(t *testing.T) { func TestGetSpotKline(t *testing.T) { t.Parallel() _, err := h.GetSpotKline(KlinesRequestParams{ - Symbol: "btcusdt", + Symbol: testSymbol, Period: TimeIntervalHour, Size: 0, }) @@ -86,7 +87,7 @@ func TestGetSpotKline(t *testing.T) { func TestGetMarketDetailMerged(t *testing.T) { t.Parallel() - _, err := h.GetMarketDetailMerged("btcusdt") + _, err := h.GetMarketDetailMerged(testSymbol) if err != nil { t.Errorf("Test failed - Huobi TestGetMarketDetailMerged: %s", err) } @@ -95,7 +96,7 @@ func TestGetMarketDetailMerged(t *testing.T) { func TestGetDepth(t *testing.T) { t.Parallel() _, err := h.GetDepth(OrderBookDataRequestParams{ - Symbol: "btcusdt", + Symbol: testSymbol, Type: OrderBookDataRequestParamsTypeStep1, }) @@ -106,7 +107,7 @@ func TestGetDepth(t *testing.T) { func TestGetTrades(t *testing.T) { t.Parallel() - _, err := h.GetTrades("btcusdt") + _, err := h.GetTrades(testSymbol) if err != nil { t.Errorf("Test failed - Huobi TestGetTrades: %s", err) } @@ -114,7 +115,7 @@ func TestGetTrades(t *testing.T) { func TestGetLatestSpotPrice(t *testing.T) { t.Parallel() - _, err := h.GetLatestSpotPrice("btcusdt") + _, err := h.GetLatestSpotPrice(testSymbol) if err != nil { t.Errorf("Test failed - Huobi GetLatestSpotPrice: %s", err) } @@ -122,7 +123,7 @@ func TestGetLatestSpotPrice(t *testing.T) { func TestGetTradeHistory(t *testing.T) { t.Parallel() - _, err := h.GetTradeHistory("btcusdt", "50") + _, err := h.GetTradeHistory(testSymbol, "50") if err != nil { t.Errorf("Test failed - Huobi TestGetTradeHistory: %s", err) } @@ -130,7 +131,7 @@ func TestGetTradeHistory(t *testing.T) { func TestGetMarketDetail(t *testing.T) { t.Parallel() - _, err := h.GetMarketDetail("btcusdt") + _, err := h.GetMarketDetail(testSymbol) if err != nil { t.Errorf("Test failed - Huobi TestGetTradeHistory: %s", err) } @@ -200,7 +201,7 @@ func TestSpotNewOrder(t *testing.T) { } arg := SpotNewOrderRequestParams{ - Symbol: "btcusdt", + Symbol: testSymbol, AccountID: 1, Amount: 0.01, Price: 10.1, @@ -238,7 +239,7 @@ func TestGetMarginLoanOrders(t *testing.T) { t.Skip() } - _, err := h.GetMarginLoanOrders("btcusdt", "", "", "", "", "", "", "") + _, err := h.GetMarginLoanOrders(testSymbol, "", "", "", "", "", "", "") if err != nil { t.Errorf("Test failed - Huobi TestGetMarginLoanOrders: %s", err) } @@ -251,7 +252,7 @@ func TestGetMarginAccountBalance(t *testing.T) { t.Skip() } - _, err := h.GetMarginAccountBalance("btcusdt") + _, err := h.GetMarginAccountBalance(testSymbol) if err != nil { t.Errorf("Test failed - Huobi TestGetMarginAccountBalance: %s", err) } diff --git a/exchanges/huobihadax/huobihadax_test.go b/exchanges/huobihadax/huobihadax_test.go index 505dfaf6..bd4dad0e 100644 --- a/exchanges/huobihadax/huobihadax_test.go +++ b/exchanges/huobihadax/huobihadax_test.go @@ -17,6 +17,7 @@ const ( apiKey = "" apiSecret = "" canManipulateRealOrders = false + testSymbol = "btcusdt" ) var h HUOBIHADAX @@ -71,7 +72,7 @@ func TestSetup(t *testing.T) { func TestGetSpotKline(t *testing.T) { t.Parallel() _, err := h.GetSpotKline(KlinesRequestParams{ - Symbol: "hptusdt", + Symbol: testSymbol, Period: TimeIntervalHour, Size: 0, }) @@ -82,7 +83,7 @@ func TestGetSpotKline(t *testing.T) { func TestGetMarketDetailMerged(t *testing.T) { t.Parallel() - _, err := h.GetMarketDetailMerged("hptusdt") + _, err := h.GetMarketDetailMerged(testSymbol) if err != nil { t.Errorf("Test failed - Huobi TestGetMarketDetailMerged: %s", err) } @@ -90,7 +91,7 @@ func TestGetMarketDetailMerged(t *testing.T) { func TestGetDepth(t *testing.T) { t.Parallel() - _, err := h.GetDepth("hptusdt", "step1") + _, err := h.GetDepth(testSymbol, "step1") if err != nil { t.Errorf("Test failed - Huobi TestGetDepth: %s", err) } @@ -98,7 +99,7 @@ func TestGetDepth(t *testing.T) { func TestGetTrades(t *testing.T) { t.Parallel() - _, err := h.GetTrades("hptusdt") + _, err := h.GetTrades(testSymbol) if err != nil { t.Errorf("Test failed - Huobi TestGetTrades: %s", err) } @@ -106,7 +107,7 @@ func TestGetTrades(t *testing.T) { func TestGetLatestSpotPrice(t *testing.T) { t.Parallel() - _, err := h.GetLatestSpotPrice("hptusdt") + _, err := h.GetLatestSpotPrice(testSymbol) if err != nil { t.Errorf("Test failed - Huobi GetLatestSpotPrice: %s", err) } @@ -114,7 +115,7 @@ func TestGetLatestSpotPrice(t *testing.T) { func TestGetTradeHistory(t *testing.T) { t.Parallel() - _, err := h.GetTradeHistory("hptusdt", "50") + _, err := h.GetTradeHistory(testSymbol, "50") if err != nil { t.Errorf("Test failed - Huobi TestGetTradeHistory: %s", err) } @@ -122,7 +123,7 @@ func TestGetTradeHistory(t *testing.T) { func TestGetMarketDetail(t *testing.T) { t.Parallel() - _, err := h.GetMarketDetail("hptusdt") + _, err := h.GetMarketDetail(testSymbol) if err != nil { t.Errorf("Test failed - Huobi TestGetTradeHistory: %s", err) } @@ -192,7 +193,7 @@ func TestSpotNewOrder(t *testing.T) { } arg := SpotNewOrderRequestParams{ - Symbol: "hptusdt", + Symbol: testSymbol, AccountID: 000000, Amount: 0.01, Price: 10.1, @@ -240,7 +241,7 @@ func TestGetMarginLoanOrders(t *testing.T) { t.Skip() } - _, err := h.GetMarginLoanOrders("hptusdt", "", "", "", "", "", "", "") + _, err := h.GetMarginLoanOrders(testSymbol, "", "", "", "", "", "", "") if err != nil { t.Errorf("Test failed - Huobi TestGetMarginLoanOrders: %s", err) } @@ -253,7 +254,7 @@ func TestGetMarginAccountBalance(t *testing.T) { t.Skip() } - _, err := h.GetMarginAccountBalance("hptusdt") + _, err := h.GetMarginAccountBalance(testSymbol) if err != nil { t.Errorf("Test failed - Huobi TestGetMarginAccountBalance: %s", err) }