Files
gocryptotrader/exchanges/binance/binance_mock_test.go
Ryan O'Hara-Reid 9f8b783c20 exchanges: Refactor UpdateTradablePairs method to remove forceUpdate parameter (#2043)
* Refactor UpdateTradablePairs method to remove forceUpdate parameter

- Updated the signature of UpdateTradablePairs in multiple exchange wrappers to remove the forceUpdate boolean parameter.
- Adjusted related test cases to reflect the change in method signature.
- Ensured that the UpdatePairs method calls within UpdateTradablePairs no longer reference the removed parameter.

* update exchange wrapper template

* linter: fix

* glorious: nits

* thrasher/glorious: nits

* Update exchanges/exchange_test.go

Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>

* Update exchanges/exchange_test.go

Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>

* Update exchanges/exchange_test.go

Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>

* fix things

* misc: fix

* Update exchanges/exchange_test.go

Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>

---------

Co-authored-by: shazbert <ryan.oharareid@thrasher.io>
Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>
2025-09-22 12:20:23 +10:00

36 lines
774 B
Go

//go:build !mock_test_off
// This will build if build tag mock_test_off is not parsed and will try to mock
// all tests in _test.go
package binance
import (
"context"
"log"
"os"
"testing"
testexch "github.com/thrasher-corp/gocryptotrader/internal/testing/exchange"
)
var mockTests = true
func TestMain(m *testing.M) {
if useTestNet {
log.Fatal("cannot use testnet with mock tests")
}
e = new(Exchange)
if err := testexch.Setup(e); err != nil {
log.Fatalf("Binance Setup error: %s", err)
}
if err := testexch.MockHTTPInstance(e); err != nil {
log.Fatalf("Binance MockHTTPInstance error: %s", err)
}
if err := e.UpdateTradablePairs(context.Background()); err != nil {
log.Fatalf("Binance UpdateTradablePairs error: %s", err)
}
os.Exit(m.Run())
}