fix mypy and tests
This commit is contained in:
@@ -142,7 +142,7 @@ def _trend(signals, buy_value, sell_value):
|
||||
return signals
|
||||
|
||||
|
||||
def _trend_alternate(dataframe=None):
|
||||
def _trend_alternate(dataframe=None, pair=None):
|
||||
signals = dataframe
|
||||
low = signals['low']
|
||||
n = len(low)
|
||||
@@ -534,7 +534,7 @@ def test_backtest_ticks(default_conf, fee, mocker):
|
||||
|
||||
def test_backtest_clash_buy_sell(mocker, default_conf):
|
||||
# Override the default buy trend function in our default_strategy
|
||||
def fun(dataframe=None):
|
||||
def fun(dataframe=None, pair=None):
|
||||
buy_value = 1
|
||||
sell_value = 1
|
||||
return _trend(dataframe, buy_value, sell_value)
|
||||
@@ -550,7 +550,7 @@ def test_backtest_clash_buy_sell(mocker, default_conf):
|
||||
|
||||
def test_backtest_only_sell(mocker, default_conf):
|
||||
# Override the default buy trend function in our default_strategy
|
||||
def fun(dataframe=None):
|
||||
def fun(dataframe=None, pair=None):
|
||||
buy_value = 0
|
||||
sell_value = 1
|
||||
return _trend(dataframe, buy_value, sell_value)
|
||||
|
||||
@@ -56,13 +56,15 @@ def test_dataframe_correct_columns(result):
|
||||
|
||||
def test_populates_buy_trend(result):
|
||||
# Load the default strategy for the unit test, because this logic is done in main.py
|
||||
dataframe = _ANALYZE.populate_buy_trend(_ANALYZE.populate_indicators(result))
|
||||
dataframe = _ANALYZE.populate_buy_trend(
|
||||
_ANALYZE.populate_indicators(result, 'UNITTEST/BTC'), 'UNITTEST/BTC')
|
||||
assert 'buy' in dataframe.columns
|
||||
|
||||
|
||||
def test_populates_sell_trend(result):
|
||||
# Load the default strategy for the unit test, because this logic is done in main.py
|
||||
dataframe = _ANALYZE.populate_sell_trend(_ANALYZE.populate_indicators(result))
|
||||
dataframe = _ANALYZE.populate_sell_trend(
|
||||
_ANALYZE.populate_indicators(result, 'UNITTEST/BTC'), 'UNITTEST/BTC')
|
||||
assert 'sell' in dataframe.columns
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user