Add missing tests for trim_tickerlist

This commit is contained in:
Matthias 2018-12-16 10:19:49 +01:00
parent 043cefd60a
commit 8826a1df5f
1 changed files with 13 additions and 0 deletions

View File

@ -450,6 +450,19 @@ def test_trim_tickerlist() -> None:
assert ticker_list_len == ticker_len
# Test invalid timerange (start after stop)
timerange = TimeRange('index', 'index', 10, 5)
with pytest.raises(ValueError, match=r'The timerange .* is incorrect'):
trim_tickerlist(ticker_list, timerange)
assert ticker_list_len == ticker_len
# passing empty list
timerange = TimeRange(None, None, None, 5)
ticker = trim_tickerlist([], timerange)
assert 0 == len(ticker)
assert not ticker
def test_file_dump_json() -> None:
file = os.path.join(os.path.dirname(__file__), '..', 'testdata',