Extend error testing to post call

This commit is contained in:
Matthias
2024-04-28 17:01:16 +02:00
parent ab10379833
commit 9d57e3930d
+12
View File
@@ -1700,9 +1700,21 @@ def test_api_pair_history(botclient, tmp_path, mocker):
lfm.reset_mock()
# No data found
if call == 'get':
rc = client_get(client,
f"{BASE_URI}/pair_history?pair=UNITTEST%2FBTC&timeframe={timeframe}"
f"&timerange=20200111-20200112&strategy={CURRENT_TEST_STRATEGY}")
else:
rc = client_post(
client,
f"{BASE_URI}/pair_history",
data={
"pair": "UNITTEST/BTC",
"timeframe": timeframe,
"timerange": "20200111-20200112",
"strategy": CURRENT_TEST_STRATEGY,
"columns": ['rsi', 'fastd', 'fastk'],
})
assert_response(rc, 502)
assert rc.json()['detail'] == ("No data for UNITTEST/BTC, 5m in 20200111-20200112 found.")