mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-30 23:16:52 +00:00
exchanges: Improve TestMain usage (#1946)
* exchanges: Improve TestMain usage * exchanges: Further cleanups * exchanges/kucoin: update TestProcessOrderbook to use test context * refactor: rename SetRunning to SetRunningURL for clarity across exchanges
This commit is contained in:
@@ -44,21 +44,14 @@ var (
|
||||
func TestMain(m *testing.M) {
|
||||
b = new(Bitfinex)
|
||||
if err := testexch.Setup(b); err != nil {
|
||||
log.Fatal(err)
|
||||
log.Fatalf("Bitfinex Setup error: %s", err)
|
||||
}
|
||||
|
||||
if apiKey != "" {
|
||||
if apiKey != "" && apiSecret != "" {
|
||||
b.Websocket.SetCanUseAuthenticatedEndpoints(true)
|
||||
b.SetCredentials(apiKey, apiSecret, "", "", "", "")
|
||||
}
|
||||
|
||||
if !b.Enabled || len(b.BaseCurrencies) < 1 {
|
||||
log.Fatal("Bitfinex Setup values not set correctly")
|
||||
}
|
||||
|
||||
if sharedtestvalues.AreAPICredentialsSet(b) {
|
||||
b.API.AuthenticatedSupport = true
|
||||
b.API.AuthenticatedWebsocketSupport = true
|
||||
b.SetCredentials(apiKey, apiSecret, "", "", "", "")
|
||||
}
|
||||
|
||||
os.Exit(m.Run())
|
||||
|
||||
Reference in New Issue
Block a user