Files
gocryptotrader/tools/exchange_template/test_file.tmpl
2018-02-16 11:48:02 +11:00

37 lines
761 B
Cheetah

{{define "test"}}
package {{.Name}}
import (
"testing"
"github.com/thrasher-/gocryptotrader/config"
)
// Please supply your own keys here for due diligence testing
const (
testAPIKey = ""
testAPISecret = ""
)
var {{.Variable}} {{.CapitalName}}
func TestSetDefaults(t *testing.T) {
{{.Variable}}.SetDefaults()
}
func TestSetup(t *testing.T) {
cfg := config.GetConfig()
cfg.LoadConfig("../../testdata/configtest.json")
{{.Name}}Config, err := cfg.GetExchangeConfig("{{.CapitalName}}")
if err != nil {
t.Error("Test Failed - {{.CapitalName}} Setup() init error")
}
{{.Name}}Config.AuthenticatedAPISupport = true
{{.Name}}Config.APIKey = testAPIKey
{{.Name}}Config.APISecret = testAPISecret
{{.Variable}}.Setup({{.Name}}Config)
}
{{end}}