From b4d27973b18531a7bc38fbbb6522875528d6838f Mon Sep 17 00:00:00 2001 From: Matthias Date: Tue, 7 Dec 2021 19:57:18 +0100 Subject: [PATCH] Update ohlcv_get_pairs test --- freqtrade/data/history/hdf5datahandler.py | 2 +- freqtrade/data/history/idatahandler.py | 2 +- freqtrade/data/history/jsondatahandler.py | 2 +- tests/data/test_history.py | 17 ++++++++--------- .../futures/XRP_USDT-1h-futures.json.gz | Bin 0 -> 2471 bytes 5 files changed, 11 insertions(+), 12 deletions(-) create mode 100644 tests/testdata/futures/XRP_USDT-1h-futures.json.gz 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 0000000000000000000000000000000000000000..f2a223b03952d7d1d8c7d2d8f8d89dfbe667a1dd GIT binary patch literal 2471 zcmV;Y30U?YiwFpyt*>DM|5#E`UsY2?R4p-REoOCeb#i5ME^2dcZU9tSYtr312-{F5 zWAn0E%QxNsHYyA!A^p+ZbdCv@K@z@yf75u)IrfM@*SzsxGakNl$8(v=c{=IEQ`uZ@ z8;jNdUA0=|S-rN~iL&&(vd)Y$?IQDd;%)f(AUzTC^BDobPXwj2R4bzGA(xCPW_E9i z6nY4n_Jpu4nfsPpI&5WV@{5-tir#8#iDJckLMXK?B(qqa8{pyRo$)a9!TX+*7uhGm zZaB)6+{ejb31=Y3zdB7MdG96S+wtcYfT=<0XA>^&nSpU;1YAgb4hIg#x~ZqY_CmRB zXNbwUbPTB@MlQZtw%tgG)&nEE^-4$#2AwB>PZ$S4U?C@2w{HbBJpX9+%+N$5IA0xh`+g@dGSX7orz*iVS{qUpN%gc_Wv z%Ak58)ZT=Sx@kGf>{-~PR#J72K>nbaAyHz2Cwc+}jn>e$KN~S=RjDi6+lZP%l4bLw%Y}zdW&i#9` z45)6_-U0$M@Z3Go5-!hjYw$@`P##AX12%Dz2cO)ieVxxz9}T?%ZLi`c&36s(Q1UeS z#)kCEDbBqJtN$$d8NbeViBPhA+qzLdbFEK^MQ$imi{k?A^Ez}aPk>it;+N;6LP943=Qc>tjb_S#5yiL3n}iqvhxH3FUzM4M-X~e60+Ou&GY(@ZNEfBN z$j>(R6X6w^d3GGnHImZwNFV;)AhqDMHSPs+KGpMVW4kAXVCR}nlQw06oSn2aHEK%g0;K&?lL;ESE!yD$QJbdVSEqDTMDqQ#=RoCz zIL=VTfEru*Ew?5sT3Vo&aj@d66t+6zoZWJokY^o)@?X)#5i~G77!b zz;5z_pJs@vKi2F>SQ`f)8AM^-s9cb1FU0-IOZ+tRhG{=pq+=Xl`VG?=pvp}Q%k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