fix tests

This commit is contained in:
Bloodhunter4rc
2024-01-26 20:55:24 +01:00
parent dd3fbfcfda
commit c398504f23
2 changed files with 6 additions and 4 deletions

View File

@@ -187,7 +187,7 @@ class RemotePairList(IPairList):
except Exception as e:
pairlist = self.init_check(f'Failed processing JSON data: {type(e)}')
else:
pairlist = self.init_check(f'RemotePairList is not of type JSON: '
pairlist = self.init_check(f'RemotePairList is not of type JSON.'
f' {self._pairlist_url}')
except requests.exceptions.RequestException:

View File

@@ -82,7 +82,7 @@ def test_fetch_pairlist_mock_response_html(mocker, rpl_config):
remote_pairlist = RemotePairList(exchange, pairlistmanager, rpl_config,
rpl_config['pairlists'][0], 0)
with pytest.raises(OperationalException, match='RemotePairList is not of type JSON, abort.'):
with pytest.raises(OperationalException, match='RemotePairList is not of type JSON.'):
remote_pairlist.fetch_pairlist()
@@ -107,9 +107,11 @@ def test_fetch_pairlist_timeout_keep_last_pairlist(mocker, rpl_config, caplog):
rpl_config['pairlists'][0], 0)
remote_pairlist._last_pairlist = ["BTC/USDT", "ETH/USDT", "LTC/USDT"]
remote_pairlist._init_done = True
pairlist_url = rpl_config['pairlists'][0]['pairlist_url']
pairs, _time_elapsed = remote_pairlist.fetch_pairlist()
assert log_has(f"Was not able to fetch pairlist from: {remote_pairlist._pairlist_url}", caplog)
assert log_has(f'Error: Was not able to fetch pairlist from: ' f'{pairlist_url}', caplog)
assert log_has("Keeping last fetched pairlist", caplog)
assert pairs == ["BTC/USDT", "ETH/USDT", "LTC/USDT"]