mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-25 15:10:24 +00:00
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
This commit is contained in:
committed by
Adrian Gallagher
parent
6bdbe236c0
commit
e2d57540a6
@@ -17,7 +17,10 @@ var mockTests = false
|
||||
|
||||
func TestMain(m *testing.M) {
|
||||
cfg := config.GetConfig()
|
||||
cfg.LoadConfig("../../testdata/configtest.json")
|
||||
err := cfg.LoadConfig("../../testdata/configtest.json", true)
|
||||
if err != nil {
|
||||
log.Fatalf("Test Failed - ANX Setup() load config error: %s", err)
|
||||
}
|
||||
anxConfig, err := cfg.GetExchangeConfig("ANX")
|
||||
if err != nil {
|
||||
log.Fatalf("Test Failed - ANX Setup() init error: %s", err)
|
||||
@@ -26,7 +29,10 @@ func TestMain(m *testing.M) {
|
||||
anxConfig.API.Credentials.Key = apiKey
|
||||
anxConfig.API.Credentials.Secret = apiSecret
|
||||
a.SetDefaults()
|
||||
a.Setup(anxConfig)
|
||||
err = a.Setup(anxConfig)
|
||||
if err != nil {
|
||||
log.Fatal("Test Failed - ANX setup error", err)
|
||||
}
|
||||
log.Printf(sharedtestvalues.LiveTesting, a.GetName(), a.API.Endpoints.URL)
|
||||
os.Exit(m.Run())
|
||||
}
|
||||
|
||||
@@ -20,7 +20,10 @@ var mockTests = true
|
||||
|
||||
func TestMain(m *testing.M) {
|
||||
cfg := config.GetConfig()
|
||||
cfg.LoadConfig("../../testdata/configtest.json")
|
||||
err := cfg.LoadConfig("../../testdata/configtest.json", true)
|
||||
if err != nil {
|
||||
log.Fatal("Test Failed - ANX load config error", err)
|
||||
}
|
||||
anxConfig, err := cfg.GetExchangeConfig("ANX")
|
||||
if err != nil {
|
||||
log.Fatal("Test Failed - Mock server error", err)
|
||||
@@ -30,7 +33,10 @@ func TestMain(m *testing.M) {
|
||||
anxConfig.API.Credentials.Key = apiKey
|
||||
anxConfig.API.Credentials.Secret = apiSecret
|
||||
a.SetDefaults()
|
||||
a.Setup(anxConfig)
|
||||
err = a.Setup(anxConfig)
|
||||
if err != nil {
|
||||
log.Fatal("Test Failed - ANX setup error", err)
|
||||
}
|
||||
|
||||
serverDetails, newClient, err := mock.NewVCRServer(mockFile)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user