mirror of
https://github.com/freqtrade/freqtrade.git
synced 2026-01-20 14:00:38 +00:00
test: add binance spot-delist test
This commit is contained in:
@@ -1158,6 +1158,26 @@ def test_check_delisting_futures(default_conf_usdt, mocker, markets):
|
||||
|
||||
|
||||
def test_get_spot_delist_schedule(default_conf_usdt, mocker):
|
||||
exchange = get_patched_exchange(mocker, default_conf_usdt, exchange="binance")
|
||||
ret_value = [{"delistTime": 1759114800000, "symbols": ["ETCBTC"]}]
|
||||
schedule_mock = mocker.patch.object(exchange, "get_spot_delist_schedule", return_value=None)
|
||||
|
||||
# None - mode is DRY
|
||||
assert exchange.get_spot_pair_delist_time("ETC/BTC") is None
|
||||
# Switch to live
|
||||
exchange._config["runmode"] = RunMode.LIVE
|
||||
assert exchange.get_spot_pair_delist_time("ETC/BTC") is None
|
||||
|
||||
mocker.patch.object(exchange, "get_spot_delist_schedule", return_value=ret_value)
|
||||
resp = exchange.get_spot_pair_delist_time("ETC/BTC")
|
||||
assert resp == dt_utc(2025, 9, 29, 3, 0)
|
||||
assert schedule_mock.call_count == 1
|
||||
schedule_mock.reset_mock()
|
||||
|
||||
# Caching - don't refresh.
|
||||
assert exchange.get_spot_pair_delist_time("ETC/BTC", refresh=False) == dt_utc(2025, 9, 29, 3, 0)
|
||||
assert schedule_mock.call_count == 0
|
||||
|
||||
api_mock = MagicMock()
|
||||
ccxt_exceptionhandlers(
|
||||
mocker,
|
||||
|
||||
Reference in New Issue
Block a user