tests: test invalid category in list

This commit is contained in:
Matthias 2024-09-28 10:14:31 +02:00
parent 8c097a81ea
commit 255ad7cac5

View File

@ -2438,6 +2438,27 @@ def test_MarketCapPairList_exceptions(mocker, default_conf_usdt):
): ):
PairListManager(exchange, default_conf_usdt) PairListManager(exchange, default_conf_usdt)
# Test invalid coinmarkets list
mocker.patch(
"freqtrade.plugins.pairlist.MarketCapPairList.FtCoinGeckoApi.get_coins_categories_list",
return_value=[
{"category_id": "layer-1"},
{"category_id": "protocol"},
{"category_id": "defi"},
],
)
default_conf_usdt["pairlists"] = [
{
"method": "MarketCapPairList",
"number_assets": 20,
"categories": ["layer-1", "defi", "layer250"],
}
]
with pytest.raises(
OperationalException, match="category layer250 not in coingecko category list."
):
PairListManager(exchange, default_conf_usdt)
@pytest.mark.parametrize( @pytest.mark.parametrize(
"pairlists,expected_error,expected_warning", "pairlists,expected_error,expected_warning",