mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-06-04 15:10:54 +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:
@@ -91,7 +91,7 @@ func TestSet(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
err = b.API.Endpoints.SetRunning(EdgeCase2.String(), "http://google.com/")
|
||||
err = b.API.Endpoints.SetRunningURL(EdgeCase2.String(), "http://google.com/")
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
@@ -102,7 +102,7 @@ func TestSet(t *testing.T) {
|
||||
if val != "http://google.com/" {
|
||||
t.Errorf("vals didn't match. expecting: %s, got: %s\n", "http://google.com/", val)
|
||||
}
|
||||
err = b.API.Endpoints.SetRunning(EdgeCase3.String(), "Added Edgecase3")
|
||||
err = b.API.Endpoints.SetRunningURL(EdgeCase3.String(), "Added Edgecase3")
|
||||
if err != nil {
|
||||
t.Errorf("not expecting an error since invalid url val err should be logged but received: %v", err)
|
||||
}
|
||||
@@ -128,7 +128,7 @@ func TestGetURL(t *testing.T) {
|
||||
if getVal != "http://test1.com/" {
|
||||
t.Errorf("getVal failed")
|
||||
}
|
||||
err = b.API.Endpoints.SetRunning(EdgeCase2.String(), "http://OVERWRITTENBRO.com.au/")
|
||||
err = b.API.Endpoints.SetRunningURL(EdgeCase2.String(), "http://OVERWRITTENBRO.com.au/")
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
@@ -1827,12 +1827,12 @@ func TestSetAPIURL(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestSetRunning(t *testing.T) {
|
||||
func TestSetRunningURL(t *testing.T) {
|
||||
b := Base{
|
||||
Name: "HELOOOOOOOO",
|
||||
}
|
||||
b.API.Endpoints = b.NewEndpoints()
|
||||
err := b.API.Endpoints.SetRunning(EdgeCase1.String(), "http://google.com/")
|
||||
err := b.API.Endpoints.SetRunningURL(EdgeCase1.String(), "http://google.com/")
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user