test: add tests for new list-timeframes behavior

This commit is contained in:
Matthias
2025-11-15 15:49:45 +01:00
parent 89274bfcdb
commit 5000927939

View File

@@ -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()