Files
gocryptotrader/exchanges/binance/binance_live_test.go
Ryan O'Hara-Reid e2d57540a6 Config overwrite bugfix (#363)
* Fix bug where on parsing an alternate new config it will overwrite main config.json in gct dir

* Stop movement of config.json file from root dir when a new config is parsed in

* Stop overiding config.json at gct dir with new config.json from root directory

* RM LN :D

* Fix bug where promptforconfig in config_encryption.go overwrites default config
Ensure periphery command packages do not interact or save over configuration
Ensure tests to not save over or change current testdata/config
2019-09-27 16:03:41 +10:00

39 lines
1.0 KiB
Go

//+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/sharedtestvalues"
)
var mockTests = false
func TestMain(m *testing.M) {
cfg := config.GetConfig()
err := cfg.LoadConfig("../../testdata/configtest.json", true)
if err != nil {
log.Fatal("Test Failed - Binance load config error", err)
}
binanceConfig, err := cfg.GetExchangeConfig("Binance")
if err != nil {
log.Fatal("Test Failed - Binance Setup() init error", err)
}
binanceConfig.API.AuthenticatedSupport = true
binanceConfig.API.Credentials.Key = apiKey
binanceConfig.API.Credentials.Secret = apiSecret
b.SetDefaults()
err = b.Setup(binanceConfig)
if err != nil {
log.Fatal("Test Failed - Binance setup error", err)
}
log.Printf(sharedtestvalues.LiveTesting, b.GetName(), b.API.Endpoints.URL)
os.Exit(m.Run())
}