mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-13 15:09:42 +00:00
* golangci-lint: Enable usetesting and unused linters * tests: Improve assertions in various test cases for clarity and accuracy * tests: Enhance error assertions in TestExecuteStrategyFromFile for improved clarity * tests: Update assertions for improved clarity and accuracy * tests: Replace assert with require for task count checks * config/versions/v7: Replace context.Background() with t.Context() * Bithumb: Centralise and consoliate testPair, relax UpdateTickers check with some glorious Doom Eternal music * Bithumb: Use UpdatePairsOnce and update remaining pair string * Bithumb: Add UpdatePairsOnce to TestUpdateTickers
32 lines
716 B
Go
32 lines
716 B
Go
package exchange_test
|
|
|
|
import (
|
|
"context"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
exchange "github.com/thrasher-corp/gocryptotrader/exchanges"
|
|
shared "github.com/thrasher-corp/gocryptotrader/exchanges/sharedtestvalues"
|
|
)
|
|
|
|
type mockEx struct {
|
|
shared.CustomEx
|
|
flow chan int
|
|
}
|
|
|
|
func (m *mockEx) UpdateTradablePairs(_ context.Context, _ bool) error {
|
|
m.flow <- 42
|
|
return nil
|
|
}
|
|
|
|
func TestBootstrap(t *testing.T) {
|
|
m := &mockEx{
|
|
shared.CustomEx{},
|
|
make(chan int, 1),
|
|
}
|
|
m.Features.Enabled.AutoPairUpdates = true
|
|
err := exchange.Bootstrap(t.Context(), m)
|
|
assert.NoError(t, err, "Bootstrap should not error")
|
|
assert.Equal(t, 42, <-m.flow, "UpdateTradablePairs should be called on the exchange")
|
|
}
|