Fix types for numpy 1.20.0 upgrade
This commit is contained in:
@@ -6,11 +6,9 @@ from unittest.mock import MagicMock
|
||||
|
||||
import pytest
|
||||
|
||||
from freqtrade.data.converter import ohlcv_to_dataframe
|
||||
from freqtrade.misc import (datesarray_to_datetimearray, file_dump_json, file_load_json,
|
||||
format_ms_time, pair_to_filename, plural, render_template,
|
||||
render_template_with_fallback, safe_value_fallback,
|
||||
safe_value_fallback2, shorten_date)
|
||||
from freqtrade.misc import (file_dump_json, file_load_json, format_ms_time, pair_to_filename,
|
||||
plural, render_template, render_template_with_fallback,
|
||||
safe_value_fallback, safe_value_fallback2, shorten_date)
|
||||
|
||||
|
||||
def test_shorten_date() -> None:
|
||||
@@ -19,22 +17,6 @@ def test_shorten_date() -> None:
|
||||
assert shorten_date(str_data) == str_shorten_data
|
||||
|
||||
|
||||
def test_datesarray_to_datetimearray(ohlcv_history_list):
|
||||
dataframes = ohlcv_to_dataframe(ohlcv_history_list, "5m", pair="UNITTEST/BTC",
|
||||
fill_missing=True)
|
||||
dates = datesarray_to_datetimearray(dataframes['date'])
|
||||
|
||||
assert isinstance(dates[0], datetime.datetime)
|
||||
assert dates[0].year == 2017
|
||||
assert dates[0].month == 11
|
||||
assert dates[0].day == 26
|
||||
assert dates[0].hour == 8
|
||||
assert dates[0].minute == 50
|
||||
|
||||
date_len = len(dates)
|
||||
assert date_len == 2
|
||||
|
||||
|
||||
def test_file_dump_json(mocker) -> None:
|
||||
file_open = mocker.patch('freqtrade.misc.open', MagicMock())
|
||||
json_dump = mocker.patch('rapidjson.dump', MagicMock())
|
||||
|
Reference in New Issue
Block a user