mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-21 15:10:12 +00:00
localbitcoins fixes (#177)
* General LocalBitcoin fixes * Added override variables to config for exchange packages to allow different API URL's
This commit is contained in:
@@ -744,3 +744,46 @@ func TestUpdateCurrencies(t *testing.T) {
|
||||
t.Errorf("Test Failed - Forced Exchange UpdateCurrencies() error: %s", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestAPIURL(t *testing.T) {
|
||||
testURL := "https://api.something.com"
|
||||
testURLSecondary := "https://api.somethingelse.com"
|
||||
testURLDefault := "https://api.defaultsomething.com"
|
||||
testURLSecondaryDefault := "https://api.defaultsomethingelse.com"
|
||||
|
||||
tester := Base{Name: "test"}
|
||||
|
||||
test := config.ExchangeConfig{}
|
||||
|
||||
err := tester.SetAPIURL(test)
|
||||
if err == nil {
|
||||
t.Error("test failed - setting zero value config")
|
||||
}
|
||||
|
||||
test.APIURL = testURL
|
||||
test.APIURLSecondary = testURLSecondary
|
||||
|
||||
tester.APIUrlDefault = testURLDefault
|
||||
tester.APIUrlSecondaryDefault = testURLSecondaryDefault
|
||||
|
||||
err = tester.SetAPIURL(test)
|
||||
if err != nil {
|
||||
t.Error("test failed", err)
|
||||
}
|
||||
|
||||
if tester.GetAPIURL() != testURL {
|
||||
t.Error("test failed - incorrect return URL")
|
||||
}
|
||||
|
||||
if tester.GetSecondaryAPIURL() != testURLSecondary {
|
||||
t.Error("test failed - incorrect return URL")
|
||||
}
|
||||
|
||||
if tester.GetAPIURLDefault() != testURLDefault {
|
||||
t.Error("test failed - incorrect return URL")
|
||||
}
|
||||
|
||||
if tester.GetAPIURLSecondaryDefault() != testURLSecondaryDefault {
|
||||
t.Error("test failed - incorrect return URL")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user