Add test confirming #4405

This commit is contained in:
Matthias 2021-02-22 11:44:39 +01:00
parent 62885166a9
commit 5e4730b73b

View File

@ -14,6 +14,7 @@ from fastapi.testclient import TestClient
from requests.auth import _basic_auth_str
from freqtrade.__init__ import __version__
from freqtrade.exceptions import ExchangeError
from freqtrade.loggers import setup_logging, setup_logging_pre
from freqtrade.persistence import PairLocks, Trade
from freqtrade.rpc import RPC
@ -789,6 +790,15 @@ def test_api_status(botclient, mocker, ticker, fee, markets):
'exchange': 'bittrex',
}]
mocker.patch('freqtrade.freqtradebot.FreqtradeBot.get_sell_rate',
MagicMock(side_effect=ExchangeError("Pair 'ETH/BTC' not available")))
rc = client_get(client, f"{BASE_URI}/status")
assert_response(rc)
resp_values = rc.json()
assert len(resp_values) == 1
assert resp_values[0]['profit_abs'] is None
def test_api_version(botclient):
ftbot, client = botclient