Test "get-signal"
This commit is contained in:
@@ -30,7 +30,7 @@ _STRATEGY = StrategyTestV2(config={})
|
||||
_STRATEGY.dp = DataProvider({}, None, None)
|
||||
|
||||
|
||||
def test_returns_latest_signal(mocker, default_conf, ohlcv_history):
|
||||
def test_returns_latest_signal(ohlcv_history):
|
||||
ohlcv_history.loc[1, 'date'] = arrow.utcnow()
|
||||
# Take a copy to correctly modify the call
|
||||
mocked_history = ohlcv_history.copy()
|
||||
@@ -60,6 +60,18 @@ def test_returns_latest_signal(mocker, default_conf, ohlcv_history):
|
||||
'buy_signal_01',
|
||||
None)
|
||||
|
||||
mocked_history.loc[1, 'buy_tag'] = None
|
||||
mocked_history.loc[1, 'exit_tag'] = 'sell_signal_01'
|
||||
|
||||
assert _STRATEGY.get_signal(
|
||||
'ETH/BTC',
|
||||
'5m',
|
||||
mocked_history) == (
|
||||
True,
|
||||
False,
|
||||
None,
|
||||
'sell_signal_01')
|
||||
|
||||
|
||||
def test_analyze_pair_empty(default_conf, mocker, caplog, ohlcv_history):
|
||||
mocker.patch.object(_STRATEGY.dp, 'ohlcv', return_value=ohlcv_history)
|
||||
|
Reference in New Issue
Block a user