mirror of
https://github.com/freqtrade/freqtrade.git
synced 2024-11-10 10:21:59 +00:00
Update ohlcv_get_pairs test
This commit is contained in:
parent
37b013c157
commit
b4d27973b1
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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', [
|
||||
|
|
BIN
tests/testdata/futures/XRP_USDT-1h-futures.json.gz
vendored
Normal file
BIN
tests/testdata/futures/XRP_USDT-1h-futures.json.gz
vendored
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user