Files
gocryptotrader/exchanges/localbitcoins/localbitcoins_live_test.go
lozdog245 52e2686b9e Change exchanges usage of GetName to Name (#378)
* Change exchanges usage of GetName to Name

* Changed GetName to Name
2019-11-20 09:50:14 +11:00

39 lines
1.0 KiB
Go

//+build mock_test_off
// This will build if build tag mock_test_off is parsed and will do live testing
// using all tests in (exchange)_test.go
package localbitcoins
import (
"log"
"os"
"testing"
"github.com/thrasher-corp/gocryptotrader/config"
"github.com/thrasher-corp/gocryptotrader/exchanges/sharedtestvalues"
)
var mockTests = false
func TestMain(m *testing.M) {
cfg := config.GetConfig()
err := cfg.LoadConfig("../../testdata/configtest.json", true)
if err != nil {
log.Fatal("LocalBitcoins load config error", err)
}
localbitcoinsConfig, err := cfg.GetExchangeConfig("LocalBitcoins")
if err != nil {
log.Fatal("LocalBitcoins Setup() init error", err)
}
localbitcoinsConfig.API.AuthenticatedSupport = true
localbitcoinsConfig.API.Credentials.Key = apiKey
localbitcoinsConfig.API.Credentials.Secret = apiSecret
l.SetDefaults()
err = l.Setup(localbitcoinsConfig)
if err != nil {
log.Fatal("Localbitcoins setup error", err)
}
log.Printf(sharedtestvalues.LiveTesting, l.Name, l.API.Endpoints.URL)
os.Exit(m.Run())
}