mirror of
https://github.com/freqtrade/freqtrade.git
synced 2025-11-29 08:33:07 +00:00
Further improve ohlcv test
This commit is contained in:
@@ -160,7 +160,10 @@ def test_ohlcv_to_dataframe_multi(timeframe):
|
|||||||
assert data.equals(df1)
|
assert data.equals(df1)
|
||||||
|
|
||||||
data1 = data.copy()
|
data1 = data.copy()
|
||||||
data1.loc[:, 'date'] = data1.loc[:, 'date'] + pd.to_timedelta('30s')
|
if timeframe in ('1M', '3M', '1y'):
|
||||||
|
data1.loc[:, 'date'] = data1.loc[:, 'date'] + pd.to_timedelta('1w')
|
||||||
|
else:
|
||||||
|
data1.loc[:, 'date'] = data1.loc[:, 'date'] + (pd.to_timedelta(timeframe) / 2)
|
||||||
df2 = ohlcv_to_dataframe(data1, timeframe, 'UNITTEST/USDT')
|
df2 = ohlcv_to_dataframe(data1, timeframe, 'UNITTEST/USDT')
|
||||||
|
|
||||||
assert len(df2) == len(data) - 1
|
assert len(df2) == len(data) - 1
|
||||||
|
|||||||
Reference in New Issue
Block a user