forked from oss-jtyd/gocryptotrader
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlocalbitcoins_live_test.go
38 lines (33 loc) · 1.01 KB
/
localbitcoins_live_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
//+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)
os.Exit(m.Run())
}