minor apiserver test change
This commit is contained in:
parent
2b9c8550b0
commit
c9d4f666c5
@ -51,12 +51,14 @@ def botclient(default_conf, mocker):
|
|||||||
ftbot = get_patched_freqtradebot(mocker, default_conf)
|
ftbot = get_patched_freqtradebot(mocker, default_conf)
|
||||||
rpc = RPC(ftbot)
|
rpc = RPC(ftbot)
|
||||||
mocker.patch('freqtrade.rpc.api_server.ApiServer.start_api', MagicMock())
|
mocker.patch('freqtrade.rpc.api_server.ApiServer.start_api', MagicMock())
|
||||||
|
apiserver = None
|
||||||
try:
|
try:
|
||||||
apiserver = ApiServer(default_conf)
|
apiserver = ApiServer(default_conf)
|
||||||
apiserver.add_rpc_handler(rpc)
|
apiserver.add_rpc_handler(rpc)
|
||||||
yield ftbot, TestClient(apiserver.app)
|
yield ftbot, TestClient(apiserver.app)
|
||||||
# Cleanup ... ?
|
# Cleanup ... ?
|
||||||
finally:
|
finally:
|
||||||
|
if apiserver:
|
||||||
apiserver.cleanup()
|
apiserver.cleanup()
|
||||||
ApiServer.shutdown()
|
ApiServer.shutdown()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user