refactor: pair_history should only be available in webserver mode

This commit is contained in:
Matthias
2025-02-01 14:09:56 +01:00
parent 5d4324dd55
commit 6b3fff6b7e
4 changed files with 81 additions and 54 deletions

View File

@@ -1914,6 +1914,15 @@ def test_api_pair_history(botclient, tmp_path, mocker):
timeframe = "5m"
lfm = mocker.patch("freqtrade.strategy.interface.IStrategy.load_freqAI_model")
# Wrong mode
rc = client_get(
client,
f"{BASE_URI}/pair_history?timeframe={timeframe}"
f"&timerange=20180111-20180112&strategy={CURRENT_TEST_STRATEGY}",
)
assert_response(rc, 503)
_ftbot.config["runmode"] = RunMode.WEBSERVER
# No pair
rc = client_get(
client,