Files
gocryptotrader/exchanges/binance/binance_mock_test.go
Ryan O'Hara-Reid 3e80f1b9e5 websocket/exchanges: populate context before multi connection upgrade (#1933)
* 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>
2025-06-17 13:43:00 +10:00

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())
}