Allow <1m timeframes for utility modes

This commit is contained in:
Matthias
2024-02-02 06:57:12 +01:00
parent 67c3bad977
commit ad121c19b0
2 changed files with 14 additions and 4 deletions

View File

@@ -9,7 +9,7 @@ import ccxt
import pytest
from pandas import DataFrame
from freqtrade.enums import CandleType, MarginMode, TradingMode
from freqtrade.enums import CandleType, MarginMode, RunMode, TradingMode
from freqtrade.exceptions import (DDosProtection, DependencyException, ExchangeError,
InsufficientFundsError, InvalidOrderException,
OperationalException, PricingError, TemporaryError)
@@ -796,7 +796,9 @@ def test_validate_timeframes_failed(default_conf, mocker):
mocker.patch(f'{EXMS}._init_ccxt', MagicMock(return_value=api_mock))
mocker.patch(f'{EXMS}._load_markets', MagicMock(return_value={}))
mocker.patch(f'{EXMS}.validate_pairs', MagicMock())
mocker.patch(f'{EXMS}.validate_pairs')
mocker.patch(f'{EXMS}.validate_stakecurrency')
mocker.patch(f'{EXMS}.validate_pricing')
with pytest.raises(OperationalException,
match=r"Invalid timeframe '3m'. This exchange supports.*"):
Exchange(default_conf)
@@ -806,6 +808,10 @@ def test_validate_timeframes_failed(default_conf, mocker):
match=r"Timeframes < 1m are currently not supported by Freqtrade."):
Exchange(default_conf)
# Will not raise an exception in util mode.
default_conf['runmode'] = RunMode.UTIL_EXCHANGE
Exchange(default_conf)
def test_validate_timeframes_emulated_ohlcv_1(default_conf, mocker):
default_conf["timeframe"] = "3m"