Update ohlcv_get_pairs test
This commit is contained in:
parent
37b013c157
commit
b4d27973b1
@ -48,7 +48,7 @@ class HDF5DataHandler(IDataHandler):
|
|||||||
cls,
|
cls,
|
||||||
datadir: Path,
|
datadir: Path,
|
||||||
timeframe: str,
|
timeframe: str,
|
||||||
candle_type: CandleType = CandleType.SPOT_
|
candle_type: CandleType
|
||||||
) -> List[str]:
|
) -> List[str]:
|
||||||
"""
|
"""
|
||||||
Returns a list of all pairs with ohlcv data available in this datadir
|
Returns a list of all pairs with ohlcv data available in this datadir
|
||||||
|
@ -52,7 +52,7 @@ class IDataHandler(ABC):
|
|||||||
cls,
|
cls,
|
||||||
datadir: Path,
|
datadir: Path,
|
||||||
timeframe: str,
|
timeframe: str,
|
||||||
candle_type: CandleType = CandleType.SPOT_
|
candle_type: CandleType
|
||||||
) -> List[str]:
|
) -> List[str]:
|
||||||
"""
|
"""
|
||||||
Returns a list of all pairs with ohlcv data available in this datadir
|
Returns a list of all pairs with ohlcv data available in this datadir
|
||||||
|
@ -49,7 +49,7 @@ class JsonDataHandler(IDataHandler):
|
|||||||
cls,
|
cls,
|
||||||
datadir: Path,
|
datadir: Path,
|
||||||
timeframe: str,
|
timeframe: str,
|
||||||
candle_type: CandleType = CandleType.SPOT_
|
candle_type: CandleType
|
||||||
) -> List[str]:
|
) -> List[str]:
|
||||||
"""
|
"""
|
||||||
Returns a list of all pairs with ohlcv data available in this datadir
|
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):
|
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
|
# Convert to set to avoid failures due to sorting
|
||||||
assert set(pairs) == {'UNITTEST/BTC', 'XLM/BTC', 'ETH/BTC', 'TRX/BTC', 'LTC/BTC',
|
assert set(pairs) == {'UNITTEST/BTC', 'XLM/BTC', 'ETH/BTC', 'TRX/BTC', 'LTC/BTC',
|
||||||
'XMR/BTC', 'ZEC/BTC', 'ADA/BTC', 'ETC/BTC', 'NXT/BTC',
|
'XMR/BTC', 'ZEC/BTC', 'ADA/BTC', 'ETC/BTC', 'NXT/BTC',
|
||||||
'DASH/BTC', 'XRP/ETH'}
|
'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'}
|
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'}
|
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'}
|
assert set(pairs) == {'UNITTEST/USDT', 'XRP/USDT'}
|
||||||
|
|
||||||
# TODO-lev: The tests below
|
pairs = JsonGzDataHandler.ohlcv_get_pairs(testdatadir, '1h', candle_type=CandleType.FUTURES)
|
||||||
# pairs = JsonGzDataHandler.ohlcv_get_pairs(testdatadir, '8m')
|
assert set(pairs) == {'XRP/USDT'}
|
||||||
# assert set(pairs) == {'UNITTEST/BTC'}
|
|
||||||
|
|
||||||
# pairs = HDF5DataHandler.ohlcv_get_pairs(testdatadir, '5m')
|
pairs = HDF5DataHandler.ohlcv_get_pairs(testdatadir, '1h', candle_type=CandleType.MARK)
|
||||||
# assert set(pairs) == {'UNITTEST/BTC'}
|
assert set(pairs) == {'UNITTEST/USDT'}
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize('filename,pair,timeframe,candletype', [
|
@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