Added unit test to check posix time arguments passed to timerange

Here is the pass report:
freqtrade_new creslin$ pytest freqtrade/tests/test_arguments.py
==================================================================== test session starts =====================================================================
platform darwin -- Python 3.6.5, pytest-3.6.0, py-1.5.3, pluggy-0.6.0
rootdir: /Users/creslin/PycharmProjects/freqtrade_new, inifile:
plugins: mock-1.10.0, cov-2.5.1
collected 19 items

freqtrade/tests/test_arguments.py ...................                                                                                                  [100%]

================================================================= 19 passed in 2.37 seconds ==================================================================
This commit is contained in:
creslinux 2018-06-02 22:46:54 +03:00
parent 43ba02afc6
commit 94e586c049

View File

@ -116,6 +116,12 @@ def test_parse_timerange_incorrect() -> None:
timerange = Arguments.parse_timerange('20100522-20150730')
assert timerange == (('date', 'date'), 1274486400, 1438214400)
# Added test for unix timestamp - BTC genesis date
assert (('date', None), 1231006505, None) == Arguments.parse_timerange('1231006505-')
assert ((None, 'date'), None, 1233360000) == Arguments.parse_timerange('-1233360000')
timerange = Arguments.parse_timerange('1231006505-1233360000')
assert timerange == (('date', 'date'), 1231006505, 1233360000)
with pytest.raises(Exception, match=r'Incorrect syntax.*'):
Arguments.parse_timerange('-')