[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:
Yonghua Li
2026-01-22 17:26:18 +08:00
committed by GitHub
parent 6b968a76f1
commit bb76d3b6f0
4 changed files with 41 additions and 45 deletions
+4 -4
View File
@@ -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