Files
gocryptotrader/exchanges/bitstamp/bitstamp_live_test.go
Bea 859c4512fb Bitstamp: Add new trading fees API endpoint; refine fee calcuations and test coverage (#1289)
* Bitstamp: WIP fixing trading fees

* Bitstamp/amended the TestGetFee test and currected the getTradingFee function

* Bitstamp: TestGetFee implemented for maker and taker

* Bitfinex: added a wrapped error

* Bitstamp: GetTradingFee and test updated, fetched from the API

Progresses #1271

* Bitstamp: minor changes- whitespace removal and comment added

* Bitstamp: fixed lint issues in TestGetBalance and TestGetTransactions

* Bitstamp:Typo in types TradingFee comment

* Bitstamp: GetAccountTradingFees at view the fees on all pairs

	modified:   exchanges/bitstamp/bitstamp.go

* Bitstamp: returning the TradingFee info instead of just MakerTakerFees

* Bitstamp:TestGetAccountTradingFees + TestGetAccountTradingFees added,data structure amended to match the outcome

* Bitstamp:error and a test for empty pair added in GetAccountTradingFee

* Bitstamp: RM the whitespace linter error
2023-10-13 15:34:21 +11:00

47 lines
1.1 KiB
Go

//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 bitstamp
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("Bitstamp load config error", err)
}
bitstampConfig, err := cfg.GetExchangeConfig("Bitstamp")
if err != nil {
log.Fatal("Bitstamp Setup() init error", err)
}
bitstampConfig.API.AuthenticatedSupport = true
if apiKey != "" {
bitstampConfig.API.Credentials.Key = apiKey
}
if apiSecret != "" {
bitstampConfig.API.Credentials.Secret = apiSecret
}
if customerID != "" {
bitstampConfig.API.Credentials.ClientID = customerID
}
b.SetDefaults()
b.Websocket = sharedtestvalues.NewTestWebsocket()
err = b.Setup(bitstampConfig)
if err != nil {
log.Fatal("Bitstamp setup error", err)
}
log.Printf(sharedtestvalues.LiveTesting, b.Name)
os.Exit(m.Run())
}