mirror of
https://github.com/freqtrade/freqtrade.git
synced 2025-11-29 16:43:06 +00:00
test: add tests for new list-timeframes behavior
This commit is contained in:
@@ -288,6 +288,52 @@ def test_list_timeframes(mocker, capsys):
|
||||
assert re.search(r"^1h$", captured.out, re.MULTILINE)
|
||||
assert re.search(r"^1d$", captured.out, re.MULTILINE)
|
||||
|
||||
api_mock.options = {
|
||||
"timeframes": {
|
||||
"spot": {"1m": "1m", "5m": "5m", "15m": "15m"},
|
||||
"swap": {"1m": "1m", "15m": "15m", "1h": "1h"},
|
||||
}
|
||||
}
|
||||
|
||||
args = [
|
||||
"list-timeframes",
|
||||
"--exchange",
|
||||
"binance",
|
||||
]
|
||||
start_list_timeframes(get_args(args))
|
||||
captured = capsys.readouterr()
|
||||
assert re.match(
|
||||
"Timeframes available for the exchange `Binance`: 1m, 5m, 15m",
|
||||
captured.out,
|
||||
)
|
||||
|
||||
args = [
|
||||
"list-timeframes",
|
||||
"--exchange",
|
||||
"binance",
|
||||
"--trading-mode",
|
||||
"spot",
|
||||
]
|
||||
start_list_timeframes(get_args(args))
|
||||
captured = capsys.readouterr()
|
||||
assert re.match(
|
||||
"Timeframes available for the exchange `Binance`: 1m, 5m, 15m",
|
||||
captured.out,
|
||||
)
|
||||
args = [
|
||||
"list-timeframes",
|
||||
"--exchange",
|
||||
"binance",
|
||||
"--trading-mode",
|
||||
"futures",
|
||||
]
|
||||
start_list_timeframes(get_args(args))
|
||||
captured = capsys.readouterr()
|
||||
assert re.match(
|
||||
"Timeframes available for the exchange `Binance`: 1m, 15m, 1h",
|
||||
captured.out,
|
||||
)
|
||||
|
||||
|
||||
def test_list_markets(mocker, markets_static, capsys):
|
||||
api_mock = MagicMock()
|
||||
|
||||
Reference in New Issue
Block a user