Update ohlcv_get_pairs test

This commit is contained in:
Matthias 2021-12-07 19:57:18 +01:00
parent 37b013c157
commit b4d27973b1
5 changed files with 11 additions and 12 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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', [

Binary file not shown.