Add test for start_websever

This commit is contained in:
Matthias
2021-04-01 07:49:54 +02:00
parent 134c61126e
commit 8566306010
2 changed files with 15 additions and 1 deletions

View File

@@ -16,6 +16,7 @@ from freqtrade.commands import (start_convert_data, start_create_userdir, start_
start_test_pairlist, start_trading)
from freqtrade.commands.deploy_commands import (clean_ui_subdir, download_and_install_ui,
get_ui_download_url, read_ui_version)
from freqtrade.commands.trade_commands import start_webserver
from freqtrade.configuration import setup_utils_configuration
from freqtrade.enums import RunMode
from freqtrade.exceptions import OperationalException
@@ -58,6 +59,18 @@ def test_start_trading_fail(mocker, caplog):
assert log_has('Fatal exception!', caplog)
def test_start_webserver(mocker, caplog):
api_server_mock = mocker.patch("freqtrade.rpc.api_server.ApiServer", )
args = [
'webserver',
'-c', 'config_bittrex.json.example'
]
start_webserver(get_args(args))
assert api_server_mock.call_count == 1
def test_list_exchanges(capsys):
args = [