mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-23 07:26:47 +00:00
* websocket/exchanges: populate context before multi connection upgrade * fix test * linter: fix * gk: dial * gk: nits rm param names --------- Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io>
40 lines
714 B
Go
40 lines
714 B
Go
//go:build !mock_test_off
|
|
|
|
// This will build if build tag mock_test_off is not parsed and will try to mock
|
|
// all tests in _test.go
|
|
package binance
|
|
|
|
import (
|
|
"context"
|
|
"log"
|
|
"os"
|
|
"testing"
|
|
|
|
testexch "github.com/thrasher-corp/gocryptotrader/internal/testing/exchange"
|
|
)
|
|
|
|
var mockTests = true
|
|
|
|
func TestMain(m *testing.M) {
|
|
if useTestNet {
|
|
log.Fatal("cannot use testnet with mock tests")
|
|
}
|
|
|
|
b = new(Binance)
|
|
if err := testexch.Setup(b); err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
|
|
if err := testexch.MockHTTPInstance(b); err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
|
|
ctx := context.Background()
|
|
b.setupOrderbookManager(ctx)
|
|
if err := b.UpdateTradablePairs(ctx, true); err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
|
|
os.Exit(m.Run())
|
|
}
|