Fix tests and flake8
This commit is contained in:
parent
3ce4d20ab9
commit
255f303850
@ -131,18 +131,18 @@ class FreqtradeBot(object):
|
|||||||
time.sleep(duration)
|
time.sleep(duration)
|
||||||
return result
|
return result
|
||||||
|
|
||||||
def refresh_tickers(self, pair_list: List[str]) -> Dict:
|
def refresh_tickers(self, pair_list: List[str]) -> bool:
|
||||||
"""
|
"""
|
||||||
Refresh tickers asyncronously and return the result.
|
Refresh tickers asyncronously and return the result.
|
||||||
"""
|
"""
|
||||||
# TODO: maybe add since_ms to use async in the download-script?
|
# TODO: maybe add since_ms to use async in the download-script?
|
||||||
# TODO: only refresh once per interval ? *may require this to move to freqtradebot.py
|
|
||||||
# TODO: Add tests for this and the async stuff above
|
# TODO: Add tests for this and the async stuff above
|
||||||
|
|
||||||
ticker_interval = self.strategy.ticker_interval
|
ticker_interval = self.strategy.ticker_interval
|
||||||
interval_in_seconds = constants.TICKER_INTERVAL_MINUTES[ticker_interval] * 60
|
interval_in_seconds = constants.TICKER_INTERVAL_MINUTES[ticker_interval] * 60
|
||||||
|
|
||||||
should_not_update = ((self._klines_last_fetched_time + interval_in_seconds +1) > round(time.time()))
|
should_not_update = ((self._klines_last_fetched_time +
|
||||||
|
interval_in_seconds + 1) > round(time.time()))
|
||||||
|
|
||||||
if should_not_update:
|
if should_not_update:
|
||||||
return False
|
return False
|
||||||
|
@ -44,7 +44,7 @@ def patch_get_signal(freqtrade: FreqtradeBot, value=(True, False)) -> None:
|
|||||||
"""
|
"""
|
||||||
freqtrade.strategy.get_signal = lambda e, s, t: value
|
freqtrade.strategy.get_signal = lambda e, s, t: value
|
||||||
freqtrade.exchange.get_candle_history = lambda p, i: None
|
freqtrade.exchange.get_candle_history = lambda p, i: None
|
||||||
freqtrade.exchange.refresh_tickers = lambda pl, i: {}
|
freqtrade.refresh_tickers = lambda i: True
|
||||||
|
|
||||||
|
|
||||||
def patch_RPCManager(mocker) -> MagicMock:
|
def patch_RPCManager(mocker) -> MagicMock:
|
||||||
|
Loading…
Reference in New Issue
Block a user