Fix tests and flake8

This commit is contained in:
Matthias 2018-08-07 08:56:06 +02:00
parent 3ce4d20ab9
commit 255f303850
2 changed files with 5 additions and 5 deletions

View File

@ -131,18 +131,18 @@ class FreqtradeBot(object):
time.sleep(duration)
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.
"""
# 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
ticker_interval = self.strategy.ticker_interval
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:
return False

View File

@ -44,7 +44,7 @@ def patch_get_signal(freqtrade: FreqtradeBot, value=(True, False)) -> None:
"""
freqtrade.strategy.get_signal = lambda e, s, t: value
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: