From 350c9037930406691fc5091fd1138d583dca33da Mon Sep 17 00:00:00 2001 From: Matthias Date: Wed, 15 May 2019 06:24:22 +0200 Subject: [PATCH] Test falsk crash --- freqtrade/tests/rpc/test_rpc_apiserver.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/freqtrade/tests/rpc/test_rpc_apiserver.py b/freqtrade/tests/rpc/test_rpc_apiserver.py index 41d682d2d..8752207d0 100644 --- a/freqtrade/tests/rpc/test_rpc_apiserver.py +++ b/freqtrade/tests/rpc/test_rpc_apiserver.py @@ -121,6 +121,13 @@ def test_api_run(default_conf, mocker, caplog): "e.g 127.0.0.1 in config.json", caplog.record_tuples) + # Test crashing flask + caplog.clear() + apiserver.app.run = MagicMock(side_effect=Exception) + apiserver.run() + assert log_has("Api server failed to start, exception message is:", + caplog.record_tuples) + def test_api_reloadconf(botclient): ftbot, client = botclient