Add test for format_ms_time

This commit is contained in:
Matthias Voppichler 2018-04-10 20:09:14 +02:00
parent 1f75636e56
commit 7123985325

View File

@ -9,7 +9,7 @@ from unittest.mock import MagicMock
from freqtrade.analyze import Analyze from freqtrade.analyze import Analyze
from freqtrade.misc import (shorten_date, datesarray_to_datetimearray, from freqtrade.misc import (shorten_date, datesarray_to_datetimearray,
common_datearray, file_dump_json) common_datearray, file_dump_json, format_ms_time)
from freqtrade.optimize.__init__ import load_tickerdata_file from freqtrade.optimize.__init__ import load_tickerdata_file
@ -76,3 +76,14 @@ def test_file_dump_json(mocker) -> None:
file_dump_json('somefile', [1, 2, 3], True) file_dump_json('somefile', [1, 2, 3], True)
assert file_open.call_count == 1 assert file_open.call_count == 1
assert json_dump.call_count == 1 assert json_dump.call_count == 1
def test_format_ms_time() -> None:
"""
test format_ms_time()
:return: None
"""
date = format_ms_time(1523383321000)
assert type(date) is str
assert date == '2018-04-10T20:02:01'
assert format_ms_time(1513152121000) == '2017-12-13T09:02:01'