more advanced use of --timerange

This commit is contained in:
kryofly
2018-01-15 22:25:02 +01:00
parent 71bb348698
commit 0e58ab7e01
9 changed files with 109 additions and 40 deletions

View File

@@ -8,7 +8,7 @@ import pytest
from jsonschema import ValidationError
from freqtrade.misc import (common_args_parser, load_config, parse_args,
throttle)
throttle, parse_timerange)
def test_throttle():
@@ -133,6 +133,13 @@ def test_parse_args_hyperopt_custom(mocker):
assert call_args.func is not None
def test_parse_timerange_incorrect():
assert ((None, 'line'), None, -200) == parse_timerange('-200')
assert (('line', None), 200, None) == parse_timerange('200-')
with pytest.raises(Exception, match=r'Incorrect syntax.*'):
parse_timerange('-')
def test_load_config(default_conf, mocker):
file_mock = mocker.patch('freqtrade.misc.open', mocker.mock_open(
read_data=json.dumps(default_conf)