mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2026-04-23 00:17:25 +08:00
[RL] [APIServer] add more status codes for update/clear api (#6141)
* [RL] add more status codes for update/clear api * [feat] return json response * [fix] fix ci
This commit is contained in:
@@ -520,14 +520,14 @@ async def test_reward_embedding_and_weights():
|
||||
|
||||
# Weight update/clear
|
||||
api_server.app.state.dynamic_load_weight = True
|
||||
api_server.app.state.engine_client.update_model_weight.return_value = (False, "fail")
|
||||
api_server.app.state.engine_client.update_model_weight.return_value = (404, "fail")
|
||||
assert api_server.update_model_weight(MagicMock()).status_code == 404
|
||||
api_server.app.state.engine_client.update_model_weight.return_value = (True, "ok")
|
||||
api_server.app.state.engine_client.update_model_weight.return_value = (200, "ok")
|
||||
assert api_server.update_model_weight(MagicMock()).status_code == 200
|
||||
|
||||
api_server.app.state.engine_client.clear_load_weight.return_value = (False, "fail")
|
||||
api_server.app.state.engine_client.clear_load_weight.return_value = (404, "fail")
|
||||
assert api_server.clear_load_weight(MagicMock()).status_code == 404
|
||||
api_server.app.state.engine_client.clear_load_weight.return_value = (True, "ok")
|
||||
api_server.app.state.engine_client.clear_load_weight.return_value = (200, "ok")
|
||||
assert api_server.clear_load_weight(MagicMock()).status_code == 200
|
||||
|
||||
# Disabled branch
|
||||
|
||||
Reference in New Issue
Block a user