chore: clarify delist-filter exception
This commit is contained in:
@@ -23,9 +23,10 @@ class DelistFilter(IPairList):
|
||||
self._max_days_from_now = self._pairlistconfig.get("max_days_from_now", 0)
|
||||
if self._max_days_from_now < 0:
|
||||
raise ConfigurationError("DelistFilter requires max_days_from_now to be >= 0")
|
||||
if not self._exchange._ft_has["has_delisting"]:
|
||||
if not self._exchange.get_option("has_delisting"):
|
||||
raise ConfigurationError(
|
||||
"DelistFilter doesn't support this exchange and trading mode combination.",
|
||||
f"DelistFilter doesn't support {self._exchange.name} in "
|
||||
f"{self._exchange.trading_mode} mode."
|
||||
)
|
||||
|
||||
def short_desc(self) -> str:
|
||||
|
||||
@@ -2850,10 +2850,10 @@ def test_backtesting_modes(
|
||||
def test_DelistFilter_error(whitelist_conf) -> None:
|
||||
whitelist_conf["pairlists"] = [{"method": "StaticPairList"}, {"method": "DelistFilter"}]
|
||||
exchange_mock = MagicMock()
|
||||
exchange_mock._ft_has = {"has_delisting": False}
|
||||
exchange_mock.get_option = MagicMock(return_value=False)
|
||||
with pytest.raises(
|
||||
OperationalException,
|
||||
match=r"DelistFilter doesn't support this exchange and trading mode combination\.",
|
||||
match=r"DelistFilter doesn't support .* in .* mode\.",
|
||||
):
|
||||
PairListManager(exchange_mock, whitelist_conf, MagicMock())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user