diff --git a/tests/commands/test_commands.py b/tests/commands/test_commands.py index 9d71ad448..bae3d7fd1 100644 --- a/tests/commands/test_commands.py +++ b/tests/commands/test_commands.py @@ -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()