Explicit test for candletype get_default

This commit is contained in:
Matthias 2021-12-08 16:20:26 +01:00
parent 35afc7b478
commit 2679744228
2 changed files with 10 additions and 2 deletions

View File

@ -284,7 +284,6 @@ def refresh_backtest_ohlcv_data(exchange: Exchange, pairs: List[str], timeframes
# Downloads what is necessary to backtest based on futures data. # Downloads what is necessary to backtest based on futures data.
timeframe = exchange._ft_has['mark_ohlcv_timeframe'] timeframe = exchange._ft_has['mark_ohlcv_timeframe']
candle_type = CandleType.from_string(exchange._ft_has['mark_ohlcv_price']) candle_type = CandleType.from_string(exchange._ft_has['mark_ohlcv_price'])
# candle_type = CandleType.MARK
# TODO: this could be in most parts to the above. # TODO: this could be in most parts to the above.
if erase: if erase:

View File

@ -14,5 +14,14 @@ from freqtrade.enums import CandleType
('mark', CandleType.MARK), ('mark', CandleType.MARK),
('premiumIndex', CandleType.PREMIUMINDEX), ('premiumIndex', CandleType.PREMIUMINDEX),
]) ])
def test_candle_type_from_string(input, expected): def test_CandleType_from_string(input, expected):
assert CandleType.from_string(input) == expected assert CandleType.from_string(input) == expected
@pytest.mark.parametrize('input,expected', [
('futures', CandleType.FUTURES),
('spot', CandleType.SPOT),
('margin', CandleType.SPOT),
])
def test_CandleType_get_default(input, expected):
assert CandleType.get_default(input) == expected