fix tests
This commit is contained in:
parent
3e786a9b8b
commit
a998d6d773
@ -52,6 +52,7 @@ def botclient(default_conf, mocker):
|
|||||||
try:
|
try:
|
||||||
apiserver = ApiServer(default_conf)
|
apiserver = ApiServer(default_conf)
|
||||||
apiserver.add_rpc_handler(rpc)
|
apiserver.add_rpc_handler(rpc)
|
||||||
|
apiserver.start_api()
|
||||||
yield ftbot, TestClient(apiserver.app)
|
yield ftbot, TestClient(apiserver.app)
|
||||||
# Cleanup ... ?
|
# Cleanup ... ?
|
||||||
finally:
|
finally:
|
||||||
@ -332,6 +333,7 @@ def test_api_run(default_conf, mocker, caplog):
|
|||||||
apiserver = ApiServer(default_conf)
|
apiserver = ApiServer(default_conf)
|
||||||
apiserver.add_rpc_handler(RPC(get_patched_freqtradebot(mocker, default_conf)))
|
apiserver.add_rpc_handler(RPC(get_patched_freqtradebot(mocker, default_conf)))
|
||||||
|
|
||||||
|
apiserver.start_api()
|
||||||
assert server_mock.call_count == 1
|
assert server_mock.call_count == 1
|
||||||
assert apiserver._config == default_conf
|
assert apiserver._config == default_conf
|
||||||
apiserver.start_api()
|
apiserver.start_api()
|
||||||
@ -406,6 +408,7 @@ def test_api_cleanup(default_conf, mocker, caplog):
|
|||||||
|
|
||||||
apiserver = ApiServer(default_conf)
|
apiserver = ApiServer(default_conf)
|
||||||
apiserver.add_rpc_handler(RPC(get_patched_freqtradebot(mocker, default_conf)))
|
apiserver.add_rpc_handler(RPC(get_patched_freqtradebot(mocker, default_conf)))
|
||||||
|
apiserver.start_api()
|
||||||
|
|
||||||
apiserver.cleanup()
|
apiserver.cleanup()
|
||||||
assert apiserver._server.cleanup.call_count == 1
|
assert apiserver._server.cleanup.call_count == 1
|
||||||
|
Loading…
Reference in New Issue
Block a user