Prevent backtest starting when not in webserver mode

#6455
This commit is contained in:
Matthias
2022-02-25 07:40:49 +01:00
parent 42df65d4ec
commit 3b1b66bee8
3 changed files with 17 additions and 5 deletions

View File

@@ -1350,6 +1350,11 @@ def test_api_backtesting(botclient, mocker, fee, caplog, tmpdir):
ftbot, client = botclient
mocker.patch('freqtrade.exchange.Exchange.get_fee', fee)
rc = client_get(client, f"{BASE_URI}/backtest")
# Backtest prevented in default mode
assert_response(rc, 502)
ftbot.config['runmode'] = RunMode.WEBSERVER
# Backtesting not started yet
rc = client_get(client, f"{BASE_URI}/backtest")
assert_response(rc)