diff --git a/freqtrade/data/history/hdf5datahandler.py b/freqtrade/data/history/hdf5datahandler.py index fe840527f..239b9a99d 100644 --- a/freqtrade/data/history/hdf5datahandler.py +++ b/freqtrade/data/history/hdf5datahandler.py @@ -48,7 +48,7 @@ class HDF5DataHandler(IDataHandler): cls, datadir: Path, timeframe: str, - candle_type: CandleType = CandleType.SPOT_ + candle_type: CandleType ) -> List[str]: """ Returns a list of all pairs with ohlcv data available in this datadir diff --git a/freqtrade/data/history/idatahandler.py b/freqtrade/data/history/idatahandler.py index 239c9ab71..59a4bc5e4 100644 --- a/freqtrade/data/history/idatahandler.py +++ b/freqtrade/data/history/idatahandler.py @@ -52,7 +52,7 @@ class IDataHandler(ABC): cls, datadir: Path, timeframe: str, - candle_type: CandleType = CandleType.SPOT_ + candle_type: CandleType ) -> List[str]: """ Returns a list of all pairs with ohlcv data available in this datadir diff --git a/freqtrade/data/history/jsondatahandler.py b/freqtrade/data/history/jsondatahandler.py index 1ed5ae023..2180b6799 100644 --- a/freqtrade/data/history/jsondatahandler.py +++ b/freqtrade/data/history/jsondatahandler.py @@ -49,7 +49,7 @@ class JsonDataHandler(IDataHandler): cls, datadir: Path, timeframe: str, - candle_type: CandleType = CandleType.SPOT_ + candle_type: CandleType ) -> List[str]: """ Returns a list of all pairs with ohlcv data available in this datadir diff --git a/tests/data/test_history.py b/tests/data/test_history.py index 18f9dc194..89b02f295 100644 --- a/tests/data/test_history.py +++ b/tests/data/test_history.py @@ -657,27 +657,26 @@ def test_convert_trades_to_ohlcv(testdatadir, tmpdir, caplog): def test_datahandler_ohlcv_get_pairs(testdatadir): - pairs = JsonDataHandler.ohlcv_get_pairs(testdatadir, '5m') + pairs = JsonDataHandler.ohlcv_get_pairs(testdatadir, '5m', candle_type=CandleType.SPOT) # Convert to set to avoid failures due to sorting assert set(pairs) == {'UNITTEST/BTC', 'XLM/BTC', 'ETH/BTC', 'TRX/BTC', 'LTC/BTC', 'XMR/BTC', 'ZEC/BTC', 'ADA/BTC', 'ETC/BTC', 'NXT/BTC', 'DASH/BTC', 'XRP/ETH'} - pairs = JsonGzDataHandler.ohlcv_get_pairs(testdatadir, '8m') + pairs = JsonGzDataHandler.ohlcv_get_pairs(testdatadir, '8m', candle_type=CandleType.SPOT) assert set(pairs) == {'UNITTEST/BTC'} - pairs = HDF5DataHandler.ohlcv_get_pairs(testdatadir, '5m') + pairs = HDF5DataHandler.ohlcv_get_pairs(testdatadir, '5m', candle_type=CandleType.SPOT) assert set(pairs) == {'UNITTEST/BTC'} - pairs = JsonDataHandler.ohlcv_get_pairs(testdatadir, '1h', candle_type='mark') + pairs = JsonDataHandler.ohlcv_get_pairs(testdatadir, '1h', candle_type=CandleType.MARK) assert set(pairs) == {'UNITTEST/USDT', 'XRP/USDT'} - # TODO-lev: The tests below - # pairs = JsonGzDataHandler.ohlcv_get_pairs(testdatadir, '8m') - # assert set(pairs) == {'UNITTEST/BTC'} + pairs = JsonGzDataHandler.ohlcv_get_pairs(testdatadir, '1h', candle_type=CandleType.FUTURES) + assert set(pairs) == {'XRP/USDT'} - # pairs = HDF5DataHandler.ohlcv_get_pairs(testdatadir, '5m') - # assert set(pairs) == {'UNITTEST/BTC'} + pairs = HDF5DataHandler.ohlcv_get_pairs(testdatadir, '1h', candle_type=CandleType.MARK) + assert set(pairs) == {'UNITTEST/USDT'} @pytest.mark.parametrize('filename,pair,timeframe,candletype', [ diff --git a/tests/testdata/futures/XRP_USDT-1h-futures.json.gz b/tests/testdata/futures/XRP_USDT-1h-futures.json.gz new file mode 100644 index 000000000..f2a223b03 Binary files /dev/null and b/tests/testdata/futures/XRP_USDT-1h-futures.json.gz differ