|
|
|
|
@ -534,6 +534,24 @@ def test_datahandler_trades_get_available_data(testdatadir):
|
|
|
|
|
assert set(paircombs) == {"XRP/ETH"}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_datahandler_trades_data_min_max(testdatadir):
|
|
|
|
|
dh = FeatherDataHandler(testdatadir)
|
|
|
|
|
min_max = dh.trades_data_min_max("XRP/ETH", TradingMode.SPOT)
|
|
|
|
|
assert len(min_max) == 3
|
|
|
|
|
|
|
|
|
|
# Empty pair
|
|
|
|
|
min_max = dh.trades_data_min_max("NADA/ETH", TradingMode.SPOT)
|
|
|
|
|
assert len(min_max) == 3
|
|
|
|
|
assert min_max[0] == datetime.fromtimestamp(0, tz=timezone.utc)
|
|
|
|
|
assert min_max[0] == min_max[1]
|
|
|
|
|
|
|
|
|
|
# Existing pair ...
|
|
|
|
|
min_max = dh.trades_data_min_max("XRP/ETH", TradingMode.SPOT)
|
|
|
|
|
assert len(min_max) == 3
|
|
|
|
|
assert min_max[0] == datetime(2019, 10, 11, 0, 0, 11, 620000, tzinfo=timezone.utc)
|
|
|
|
|
assert min_max[1] == datetime(2019, 10, 13, 11, 19, 28, 844000, tzinfo=timezone.utc)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_gethandlerclass():
|
|
|
|
|
cl = get_datahandlerclass("json")
|
|
|
|
|
assert cl == JsonDataHandler
|
|
|
|
|
|