Files
gocryptotrader/exchanges/gemini/gemini_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

40 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 gemini
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 - Gemini load config error", err)
}
geminiConfig, err := cfg.GetExchangeConfig("Gemini")
if err != nil {
log.Fatal("Test Failed - Gemini Setup() init error", err)
}
geminiConfig.API.AuthenticatedSupport = true
geminiConfig.API.Credentials.Key = apiKey
geminiConfig.API.Credentials.Secret = apiSecret
g.SetDefaults()
err = g.Setup(geminiConfig)
if err != nil {
log.Fatal("Test Failed - Gemini setup error", err)
}
g.API.Endpoints.URL = geminiSandboxAPIURL
log.Printf(sharedtestvalues.LiveTesting, g.GetName(), g.API.Endpoints.URL)
os.Exit(m.Run())
}