Test falsk crash

This commit is contained in:
Matthias 2019-05-15 06:24:22 +02:00
parent 39afe4c7bd
commit 350c903793

View File

@ -121,6 +121,13 @@ def test_api_run(default_conf, mocker, caplog):
"e.g 127.0.0.1 in config.json", "e.g 127.0.0.1 in config.json",
caplog.record_tuples) 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): def test_api_reloadconf(botclient):
ftbot, client = botclient ftbot, client = botclient