fix testcases

This commit is contained in:
ycchen 2021-02-06 19:39:43 +01:00
parent 5fed7b81de
commit 288f7257eb
4 changed files with 6 additions and 7 deletions

View File

@ -208,6 +208,11 @@ func (e Exchange) QueryTrades(ctx context.Context, symbol string, options *types
return nil, nil
}
func (e Exchange) QueryTickers(ctx context.Context, symbol ...string) (map[string]types.Ticker, error) {
// Not using Tickers in back test (yet)
return nil, nil
}
func (e Exchange) Name() types.ExchangeName {
return e.publicExchange.Name()
}

View File

@ -2,7 +2,6 @@ package binance
import (
"context"
"fmt"
"testing"
)
@ -28,7 +27,6 @@ func TestSomeSymbols(t *testing.T) {
}
if len(got) != 2 {
fmt.Println(got)
t.Errorf("Binance Exchange: Attempting to get two symbols, but number of tickers do not match")
}
@ -42,7 +40,6 @@ func TestSingleSymbol(t *testing.T) {
}
if len(got) != 1 {
fmt.Println(got)
t.Errorf("Binance Exchange: Attempting to get one symbol, but number of tickers do not match")
}

View File

@ -74,7 +74,7 @@ func (e *Exchange) QueryTickers(ctx context.Context, symbol ...string) (map[stri
}
for k, v := range tickers {
if _, ok := m[strings.ToUpper(k)]; !ok {
if _, ok := m[strings.ToUpper(k)]; len(symbol) != 0 && !ok {
continue
}
ret[strings.ToUpper(k)] = types.Ticker{

View File

@ -2,7 +2,6 @@ package max
import (
"context"
"fmt"
"testing"
)
@ -27,7 +26,6 @@ func TestSomeSymbols(t *testing.T) {
}
if len(got) != 2 {
fmt.Println(got)
t.Errorf("Max Exchange: Attempting to get two symbols, but number of tickers do not match")
}
@ -41,7 +39,6 @@ func TestSingleSymbol(t *testing.T) {
}
if len(got) != 1 {
fmt.Println(got)
t.Errorf("Max Exchange: Attempting to get one symbol, but number of tickers do not match")
}