Test exchange initialization without stake currency

This commit is contained in:
Matthias 2020-02-08 09:53:20 +01:00
parent fff8ced3b0
commit 86ee545a5b
2 changed files with 3 additions and 2 deletions

View File

@ -284,7 +284,8 @@ class Exchange:
:raise: OperationalException if stake-currency is not available.
"""
quote_currencies = self.get_quote_currencies()
if stake_currency not in quote_currencies:
# stake_currency can be empty for certain util commands.
if stake_currency and stake_currency not in quote_currencies:
raise OperationalException(
f"{stake_currency} is not available as stake on {self.name}. "
f"Available currencies are: {', '.join(quote_currencies)}")

View File

@ -365,7 +365,7 @@ def test__reload_markets_exception(default_conf, mocker, caplog):
assert log_has_re(r"Could not reload markets.*", caplog)
@pytest.mark.parametrize("stake_currency", ['ETH', 'BTC', 'USDT'])
@pytest.mark.parametrize("stake_currency", ['ETH', 'BTC', 'USDT', ''])
def test_validate_stake_currency(default_conf, stake_currency, mocker, caplog):
default_conf['stake_currency'] = stake_currency
api_mock = MagicMock()