Move dataframe trim to within jsondatahandler

This commit is contained in:
Matthias
2019-12-26 09:51:03 +01:00
parent 552c93abf0
commit e861f05b75
4 changed files with 25 additions and 13 deletions

View File

@@ -369,8 +369,9 @@ def test_load_partial_missing(testdatadir, caplog) -> None:
# timedifference in 5 minutes
td = ((end - start).total_seconds() // 60 // 5) + 1
assert td != len(tickerdata['UNITTEST/BTC'])
# This validation happens now after parsing to pandas.
end_real = arrow.get(tickerdata['UNITTEST/BTC'].iloc[-1, 0])
# Shift endtime with +5 - as last candle is dropped (partial candle)
end_real = arrow.get(tickerdata['UNITTEST/BTC'].iloc[-1, 0]).shift(minutes=5)
assert log_has(f'Missing data at end for pair '
f'UNITTEST/BTC, data ends at {end_real.strftime("%Y-%m-%d %H:%M:%S")}',
caplog)