mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-13 23:16:45 +00:00
okx: GetDefaultConfig fix & ticker field improvements (#1227)
* okx: updaterooo (cherry pick) * okx: add in target currency handling in spot market orders * okx:don't adjust order.Submit variables. * spell checker * okx_wrapper: updateTradablePairs true bool * thrasher: nits * purge default env vars * point to CI env var * print out environment * lol --------- Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io>
This commit is contained in:
@@ -1,12 +1,15 @@
|
||||
package engine
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"os"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/thrasher-corp/gocryptotrader/common"
|
||||
"github.com/thrasher-corp/gocryptotrader/config"
|
||||
exchange "github.com/thrasher-corp/gocryptotrader/exchanges"
|
||||
)
|
||||
|
||||
func TestLoadConfigWithSettings(t *testing.T) {
|
||||
@@ -338,3 +341,42 @@ func TestSettingsPrint(t *testing.T) {
|
||||
s = &Settings{}
|
||||
s.PrintLoadedSettings()
|
||||
}
|
||||
|
||||
func TestGetDefaultConfigurations(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
man := NewExchangeManager()
|
||||
for x := range exchange.Exchanges {
|
||||
target := exchange.Exchanges[x]
|
||||
t.Run(target, func(t *testing.T) {
|
||||
t.Parallel()
|
||||
exch, err := man.NewExchangeByName(target)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
if isCITest() && common.StringDataContains(blockedCIExchanges, target) {
|
||||
t.Skipf("skipping %s due to CI test restrictions", target)
|
||||
}
|
||||
|
||||
cfg, err := exch.GetDefaultConfig(context.Background())
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
if cfg == nil {
|
||||
t.Fatal("expected config")
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func isCITest() bool {
|
||||
ci := os.Getenv("CI")
|
||||
return ci == "true" /* github actions */ || ci == "True" /* appveyor */
|
||||
}
|
||||
|
||||
// blockedCIExchanges are exchanges that are not able to be tested on CI
|
||||
var blockedCIExchanges = []string{
|
||||
"binance", // binance API is banned from executing within the US where github Actions is ran
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user