tests/optimize/test_optimize.py:

Added test for gzip ticker file.
BTC_UNITEST-8.json.gz:
Added to test gzip loading.
This commit is contained in:
Michael Smith 2018-01-29 10:22:55 +08:00
parent e3b295cecc
commit 4799e1ed44

View File

@ -202,9 +202,14 @@ def test_download_backtesting_testdata2(mocker):
def test_load_tickerdata_file(): def test_load_tickerdata_file():
#7 does not exist in either format.
assert not load_tickerdata_file(None, 'BTC_UNITEST', 7) assert not load_tickerdata_file(None, 'BTC_UNITEST', 7)
#1 exists only as a .json
tickerdata = load_tickerdata_file(None, 'BTC_UNITEST', 1) tickerdata = load_tickerdata_file(None, 'BTC_UNITEST', 1)
assert _BTC_UNITTEST_LENGTH == len(tickerdata) assert _BTC_UNITTEST_LENGTH == len(tickerdata)
#8 .json is empty and will fail if it's loaded. .json.gz is a copy of 1.json
tickerdata = load_tickerdata_file(None, 'BTC_UNITEST', 8)
assert _BTC_UNITTEST_LENGTH == len(tickerdata)
def test_init(default_conf, mocker): def test_init(default_conf, mocker):