From e75f31ee86805be0759e9cacc990266d76cc9181 Mon Sep 17 00:00:00 2001 From: Matthias Date: Fri, 3 Dec 2021 15:20:18 +0100 Subject: [PATCH] Create correct Type for PairWithTimeFrame --- freqtrade/constants.py | 6 +++--- tests/test_freqtradebot.py | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/freqtrade/constants.py b/freqtrade/constants.py index ebb817e8d..53f2c0ddf 100644 --- a/freqtrade/constants.py +++ b/freqtrade/constants.py @@ -5,6 +5,8 @@ bot constants """ from typing import List, Tuple +from freqtrade.enums import CandleType + DEFAULT_CONFIG = 'config.json' DEFAULT_EXCHANGE = 'bittrex' @@ -475,9 +477,7 @@ CANCEL_REASON = { } # List of pairs with their timeframes -# TODO-lev: This should really be -# PairWithTimeframe = Tuple[str, str, CandleType] -PairWithTimeframe = Tuple[str, str, str] +PairWithTimeframe = Tuple[str, str, CandleType] ListPairsWithTimeframes = List[PairWithTimeframe] # Type for trades list diff --git a/tests/test_freqtradebot.py b/tests/test_freqtradebot.py index 127fc1d1f..6a6972b69 100644 --- a/tests/test_freqtradebot.py +++ b/tests/test_freqtradebot.py @@ -698,7 +698,8 @@ def test_process_informative_pairs_added(default_conf_usdt, ticker_usdt, mocker) assert refresh_mock.call_count == 1 assert ("BTC/ETH", "1m", CandleType.SPOT_) in refresh_mock.call_args[0][0] assert ("ETH/USDT", "1h", CandleType.SPOT_) in refresh_mock.call_args[0][0] - assert ("ETH/USDT", default_conf_usdt["timeframe"], CandleType.SPOT) in refresh_mock.call_args[0][0] + assert ("ETH/USDT", default_conf_usdt["timeframe"], + CandleType.SPOT) in refresh_mock.call_args[0][0] @pytest.mark.parametrize("trading_mode", [