Add resiliancy against not having a analyzed dataframe yet

This commit is contained in:
Matthias
2020-08-24 20:38:01 +02:00
parent c59a1be154
commit c0654f3caf
2 changed files with 39 additions and 17 deletions

View File

@@ -817,6 +817,16 @@ def test_api_pair_candles(botclient, ohlcv_history):
ftbot, client = botclient
timeframe = '5m'
amount = 2
rc = client_get(client,
f"{BASE_URI}/pair_candles?limit={amount}&pair=XRP%2FBTC&timeframe={timeframe}")
assert_response(rc)
assert 'columns' in rc.json
assert 'data_start_ts' in rc.json
assert 'data_start' in rc.json
assert 'data_stop' in rc.json
assert 'data_stop_ts' in rc.json
assert len(rc.json['data']) == 0
ohlcv_history['sma'] = ohlcv_history['close'].rolling(2).mean()
ohlcv_history['buy'] = 0
ohlcv_history.iloc[1]['buy'] = 1