mirror of
https://github.com/freqtrade/freqtrade.git
synced 2026-01-20 05:50:36 +00:00
test: update tests for new timeframe approach
This commit is contained in:
@@ -198,6 +198,8 @@ def test_list_timeframes(mocker, capsys):
|
||||
"1h": "hour",
|
||||
"1d": "day",
|
||||
}
|
||||
api_mock.options = {}
|
||||
|
||||
patch_exchange(mocker, api_mock=api_mock, exchange="bybit")
|
||||
args = [
|
||||
"list-timeframes",
|
||||
|
||||
@@ -742,10 +742,11 @@ def test_get_pair_base_currency(default_conf, mocker, pair, expected):
|
||||
def test_validate_timeframes(default_conf, mocker, timeframe):
|
||||
default_conf["timeframe"] = timeframe
|
||||
api_mock = MagicMock()
|
||||
id_mock = PropertyMock(return_value="test_exchange")
|
||||
type(api_mock).id = id_mock
|
||||
timeframes = PropertyMock(return_value={"1m": "1m", "5m": "5m", "15m": "15m", "1h": "1h"})
|
||||
type(api_mock).timeframes = timeframes
|
||||
id_mock = MagicMock(return_value="test_exchange")
|
||||
api_mock.id = id_mock
|
||||
api_mock.options = {}
|
||||
timeframes = {"1m": "1m", "5m": "5m", "15m": "15m", "1h": "1h"}
|
||||
api_mock.timeframes = timeframes
|
||||
|
||||
mocker.patch(f"{EXMS}._init_ccxt", MagicMock(return_value=api_mock))
|
||||
mocker.patch(f"{EXMS}.reload_markets")
|
||||
@@ -757,12 +758,11 @@ def test_validate_timeframes(default_conf, mocker, timeframe):
|
||||
def test_validate_timeframes_failed(default_conf, mocker):
|
||||
default_conf["timeframe"] = "3m"
|
||||
api_mock = MagicMock()
|
||||
id_mock = PropertyMock(return_value="test_exchange")
|
||||
type(api_mock).id = id_mock
|
||||
timeframes = PropertyMock(
|
||||
return_value={"15s": "15s", "1m": "1m", "5m": "5m", "15m": "15m", "1h": "1h"}
|
||||
)
|
||||
type(api_mock).timeframes = timeframes
|
||||
id_mock = MagicMock(return_value="test_exchange")
|
||||
api_mock.id = id_mock
|
||||
timeframes = {"15s": "15s", "1m": "1m", "5m": "5m", "15m": "15m", "1h": "1h"}
|
||||
api_mock.timeframes = timeframes
|
||||
api_mock.options = {}
|
||||
|
||||
mocker.patch(f"{EXMS}._init_ccxt", MagicMock(return_value=api_mock))
|
||||
mocker.patch(f"{EXMS}.reload_markets")
|
||||
|
||||
Reference in New Issue
Block a user