chore: add test for trades_get_available_data

This commit is contained in:
Matthias
2024-08-13 06:40:11 +02:00
parent cf26635e3c
commit 3f4c19abbc

View File

@@ -519,6 +519,21 @@ def test_datahandler_trades_purge(mocker, testdatadir, datahandler):
assert unlinkmock.call_count == 1
def test_datahandler_trades_get_available_data(testdatadir):
paircombs = FeatherDataHandler.trades_get_available_data(testdatadir, TradingMode.SPOT)
# Convert to set to avoid failures due to sorting
assert set(paircombs) == {"XRP/ETH"}
paircombs = FeatherDataHandler.trades_get_available_data(testdatadir, TradingMode.FUTURES)
# Convert to set to avoid failures due to sorting
assert set(paircombs) == set()
paircombs = JsonGzDataHandler.trades_get_available_data(testdatadir, TradingMode.SPOT)
assert set(paircombs) == {"XRP/ETH", "XRP/OLD"}
paircombs = HDF5DataHandler.trades_get_available_data(testdatadir, TradingMode.SPOT)
assert set(paircombs) == {"XRP/ETH"}
def test_gethandlerclass():
cl = get_datahandlerclass("json")
assert cl == JsonDataHandler