Skip to content

Commit 4ad049a

Browse files
committed
test: add test-case for futures filter
1 parent 03c16d0 commit 4ad049a

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/commands/test_commands.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,8 @@ def test_list_exchanges(capsys):
133133
captured = capsys.readouterr()
134134
assert re.search(r"^binance$", captured.out, re.MULTILINE)
135135
assert re.search(r"^bybit$", captured.out, re.MULTILINE)
136+
# An exchange not supporting futures
137+
assert re.search(r"^kraken$", captured.out, re.MULTILINE)
136138

137139
# Test with --all
138140
args = [
@@ -173,6 +175,19 @@ def test_list_exchanges(capsys):
173175
assert not re.search(r".*bingx.*", captured.out)
174176
assert re.search(r".*hyperliquid.*", captured.out)
175177

178+
# Only futures
179+
args = [
180+
"list-exchanges",
181+
"--trading-mode",
182+
"futures",
183+
]
184+
185+
start_list_exchanges(get_args(args))
186+
captured = capsys.readouterr()
187+
assert re.search(r"Exchanges available for Freqtrade.*", captured.out)
188+
assert re.search(r".*binance.*", captured.out)
189+
assert not re.search(r".*kraken.*", captured.out)
190+
176191

177192
def test_list_timeframes(mocker, capsys):
178193
api_mock = MagicMock()

0 commit comments

Comments
 (0)