Files
gocryptotrader/exchanges/binance/binance_live_test.go
Ryan O'Hara-Reid 0b6916cd45 binance: adjust outbound start and end time payload strings and update unix to milliseconds (#1039)
* binance: adjust outbound start and end time to millisecond

* binance: set correct strings

* binance: convert to unixmilli and fix tests

* nits: fix execution limits, remove deprecated functions, fix tests requiring live tests to stay within a 30day time period.

* binance: rm params unused

* binance: comment fix

Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io>
2022-09-20 16:40:31 +10:00

45 lines
1.2 KiB
Go

//go:build mock_test_off
// +build mock_test_off
// This will build if build tag mock_test_off is parsed and will do live testing
// using all tests in (exchange)_test.go
package binance
import (
"log"
"os"
"testing"
"github.com/thrasher-corp/gocryptotrader/config"
"github.com/thrasher-corp/gocryptotrader/exchanges/request"
"github.com/thrasher-corp/gocryptotrader/exchanges/sharedtestvalues"
)
var mockTests = false
func TestMain(m *testing.M) {
cfg := config.GetConfig()
err := cfg.LoadConfig("../../testdata/configtest.json", true)
if err != nil {
log.Fatal("Binance load config error", err)
}
binanceConfig, err := cfg.GetExchangeConfig("Binance")
if err != nil {
log.Fatal("Binance Setup() init error", err)
}
binanceConfig.API.AuthenticatedSupport = true
binanceConfig.API.Credentials.Key = apiKey
binanceConfig.API.Credentials.Secret = apiSecret
b.SetDefaults()
b.Websocket = sharedtestvalues.NewTestWebsocket()
err = b.Setup(binanceConfig)
if err != nil {
log.Fatal("Binance setup error", err)
}
b.setupOrderbookManager()
request.MaxRequestJobs = 100
b.Websocket.DataHandler = sharedtestvalues.GetWebsocketInterfaceChannelOverride()
log.Printf(sharedtestvalues.LiveTesting, b.Name)
os.Exit(m.Run())
}