add mock for get_history in patch_get_signal

This commit is contained in:
Matthias 2018-07-26 18:58:49 +01:00
parent 484103b957
commit 3324cdfcbe
2 changed files with 3 additions and 2 deletions

View File

@ -337,8 +337,8 @@ class FreqtradeBot(object):
(buy, sell) = self.strategy.get_signal(_pair, interval, th[_pair])
if buy and not sell:
bought_at_least_one |= self.execute_buy(_pair, stake_amount)
return bought_at_least_one
return self.execute_buy(_pair, stake_amount)
return False
def execute_buy(self, pair: str, stake_amount: float) -> bool:
"""

View File

@ -47,6 +47,7 @@ def patch_get_signal(freqtrade: FreqtradeBot, value=(True, False)) -> None:
:return: None
"""
freqtrade.strategy.get_signal = lambda e, s, t: value
freqtrade.exchange.get_ticker_history = lambda p, i: None
def patch_RPCManager(mocker) -> MagicMock: