add mock for get_history in patch_get_signal
This commit is contained in:
parent
484103b957
commit
3324cdfcbe
@ -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:
|
||||
"""
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user