Extend error testing to post call
This commit is contained in:
@@ -1699,12 +1699,24 @@ def test_api_pair_history(botclient, tmp_path, mocker):
|
|||||||
assert result['data_stop_ts'] == 1515715200000
|
assert result['data_stop_ts'] == 1515715200000
|
||||||
lfm.reset_mock()
|
lfm.reset_mock()
|
||||||
|
|
||||||
# No data found
|
# No data found
|
||||||
rc = client_get(client,
|
if call == 'get':
|
||||||
f"{BASE_URI}/pair_history?pair=UNITTEST%2FBTC&timeframe={timeframe}"
|
rc = client_get(client,
|
||||||
f"&timerange=20200111-20200112&strategy={CURRENT_TEST_STRATEGY}")
|
f"{BASE_URI}/pair_history?pair=UNITTEST%2FBTC&timeframe={timeframe}"
|
||||||
assert_response(rc, 502)
|
f"&timerange=20200111-20200112&strategy={CURRENT_TEST_STRATEGY}")
|
||||||
assert rc.json()['detail'] == ("No data for UNITTEST/BTC, 5m in 20200111-20200112 found.")
|
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.")
|
||||||
|
|
||||||
|
|
||||||
def test_api_plot_config(botclient, mocker, tmp_path):
|
def test_api_plot_config(botclient, mocker, tmp_path):
|
||||||
|
|||||||
Reference in New Issue
Block a user