From e6ee55a69b8aa12015b61bc06c2ab6bc9e8e8809 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 9 Jul 2023 11:37:06 +0200 Subject: [PATCH] Improve some test coverage --- freqtrade/plugins/pairlist/RemotePairList.py | 4 ++-- tests/plugins/test_remotepairlist.py | 17 ++++++++++++++++- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/freqtrade/plugins/pairlist/RemotePairList.py b/freqtrade/plugins/pairlist/RemotePairList.py index 6a16671f6..66b7d9496 100644 --- a/freqtrade/plugins/pairlist/RemotePairList.py +++ b/freqtrade/plugins/pairlist/RemotePairList.py @@ -65,7 +65,7 @@ class RemotePairList(IPairList): if self._pairlist_pos == 0 and self._mode == 'blacklist': raise OperationalException( - 'At `blacklist` mode RemotePairList can not be on the first ' + 'A `blacklist` mode RemotePairList can not be on the first ' 'position of your pairlist.') @property @@ -85,7 +85,7 @@ class RemotePairList(IPairList): @staticmethod def description() -> str: - return "Retrieve pairs from a remote API." + return "Retrieve pairs from a remote API or local file." @staticmethod def available_parameters() -> Dict[str, PairlistParameter]: diff --git a/tests/plugins/test_remotepairlist.py b/tests/plugins/test_remotepairlist.py index 4c69f6b8b..56f62f227 100644 --- a/tests/plugins/test_remotepairlist.py +++ b/tests/plugins/test_remotepairlist.py @@ -197,13 +197,28 @@ def test_remote_pairlist_init_wrong_mode(mocker, rpl_config): } ] - get_patched_exchange(mocker, rpl_config) with pytest.raises( OperationalException, match=r'`mode` not configured correctly. Supported Modes are "whitelist","blacklist"' ): get_patched_freqtradebot(mocker, rpl_config) + rpl_config['pairlists'] = [ + { + "method": "RemotePairList", + "mode": "blacklist", + "number_assets": 20, + "pairlist_url": "http://example.com/pairlist", + "keep_pairlist_on_failure": True, + } + ] + + with pytest.raises( + OperationalException, + match=r'A `blacklist` mode RemotePairList can not be.*first.*' + ): + get_patched_freqtradebot(mocker, rpl_config) + def test_remote_pairlist_init_wrong_proc_mode(mocker, rpl_config): rpl_config['pairlists'] = [