Create correct Type for PairWithTimeFrame

This commit is contained in:
Matthias 2021-12-03 15:20:18 +01:00
parent bead867940
commit e75f31ee86
2 changed files with 5 additions and 4 deletions

View File

@ -5,6 +5,8 @@ bot constants
""" """
from typing import List, Tuple from typing import List, Tuple
from freqtrade.enums import CandleType
DEFAULT_CONFIG = 'config.json' DEFAULT_CONFIG = 'config.json'
DEFAULT_EXCHANGE = 'bittrex' DEFAULT_EXCHANGE = 'bittrex'
@ -475,9 +477,7 @@ CANCEL_REASON = {
} }
# List of pairs with their timeframes # List of pairs with their timeframes
# TODO-lev: This should really be PairWithTimeframe = Tuple[str, str, CandleType]
# PairWithTimeframe = Tuple[str, str, CandleType]
PairWithTimeframe = Tuple[str, str, str]
ListPairsWithTimeframes = List[PairWithTimeframe] ListPairsWithTimeframes = List[PairWithTimeframe]
# Type for trades list # Type for trades list

View File

@ -698,7 +698,8 @@ def test_process_informative_pairs_added(default_conf_usdt, ticker_usdt, mocker)
assert refresh_mock.call_count == 1 assert refresh_mock.call_count == 1
assert ("BTC/ETH", "1m", CandleType.SPOT_) in refresh_mock.call_args[0][0] 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", "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", [ @pytest.mark.parametrize("trading_mode", [