fix tests

This commit is contained in:
Timothy Pogue 2022-08-26 14:52:15 -06:00
parent 3e786a9b8b
commit a998d6d773

View File

@ -52,6 +52,7 @@ def botclient(default_conf, mocker):
try:
apiserver = ApiServer(default_conf)
apiserver.add_rpc_handler(rpc)
apiserver.start_api()
yield ftbot, TestClient(apiserver.app)
# Cleanup ... ?
finally:
@ -332,6 +333,7 @@ def test_api_run(default_conf, mocker, caplog):
apiserver = ApiServer(default_conf)
apiserver.add_rpc_handler(RPC(get_patched_freqtradebot(mocker, default_conf)))
apiserver.start_api()
assert server_mock.call_count == 1
assert apiserver._config == default_conf
apiserver.start_api()
@ -406,6 +408,7 @@ def test_api_cleanup(default_conf, mocker, caplog):
apiserver = ApiServer(default_conf)
apiserver.add_rpc_handler(RPC(get_patched_freqtradebot(mocker, default_conf)))
apiserver.start_api()
apiserver.cleanup()
assert apiserver._server.cleanup.call_count == 1