Skip to content

Commit 3582437

Browse files
formatting
1 parent 5baf623 commit 3582437

File tree

3 files changed

+20
-14
lines changed

3 files changed

+20
-14
lines changed

ads/aqua/model/model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ def edit_registered_model(self, id, inference_container, enable_finetuning, task
419419
return AquaApp().update_model(id, update_model_details).data
420420
else:
421421
raise AquaRuntimeError(
422-
f"Failed to edit model:{id}. Only registered unverified models can be deleted."
422+
f"Failed to edit model:{id}. Only registered unverified models can be edited."
423423
)
424424

425425
def _fetch_metric_from_metadata(

tests/unitary/with_extras/aqua/test_deployment_handler.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -93,22 +93,26 @@ def test_get_deployment(self, mock_get):
9393
mock_get.assert_called()
9494

9595
@patch("ads.aqua.modeldeployment.AquaDeploymentApp.delete")
96-
def test_delete_deployment(self,mock_delete):
96+
def test_delete_deployment(self, mock_delete):
9797
self.deployment_handler.request.path = "aqua/deployments"
9898
self.deployment_handler.delete("mock-model-id")
9999
mock_delete.assert_called()
100100

101101
@patch("ads.aqua.modeldeployment.AquaDeploymentApp.activate")
102-
def test_activate_deployment(self,mock_activate):
103-
self.deployment_handler.request.path = "aqua/deployments/ocid1.datasciencemodeldeployment.oc1.iad.xxx/activate"
104-
mock_activate.return_value={"lifecycle_state":"UPDATING"}
102+
def test_activate_deployment(self, mock_activate):
103+
self.deployment_handler.request.path = (
104+
"aqua/deployments/ocid1.datasciencemodeldeployment.oc1.iad.xxx/activate"
105+
)
106+
mock_activate.return_value = {"lifecycle_state": "UPDATING"}
105107
self.deployment_handler.put()
106108
mock_activate.assert_called()
107109

108110
@patch("ads.aqua.modeldeployment.AquaDeploymentApp.deactivate")
109-
def test_deactivate_deployment(self,mock_deactivate):
110-
self.deployment_handler.request.path = "aqua/deployments/ocid1.datasciencemodeldeployment.oc1.iad.xxx/deactivate"
111-
mock_deactivate.return_value={"lifecycle_state":"UPDATING"}
111+
def test_deactivate_deployment(self, mock_deactivate):
112+
self.deployment_handler.request.path = (
113+
"aqua/deployments/ocid1.datasciencemodeldeployment.oc1.iad.xxx/deactivate"
114+
)
115+
mock_deactivate.return_value = {"lifecycle_state": "UPDATING"}
112116
self.deployment_handler.put()
113117
mock_deactivate.assert_called()
114118

tests/unitary/with_extras/aqua/test_model_handler.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,10 @@ def test_delete_with_id(self, mock_delete, mock_urlparse):
9494
mock_urlparse.assert_called()
9595
mock_delete.assert_called()
9696

97-
@patch.object(AquaContainerConfig,"from_container_index_json")
98-
@patch.object(AquaModelApp,"edit_registered_model")
99-
def test_put(self,mock_edit,mock_container_index):
100-
mock_edit.return_value={"state":"EDITED"}
97+
@patch.object(AquaContainerConfig, "from_container_index_json")
98+
@patch.object(AquaModelApp, "edit_registered_model")
99+
def test_put(self, mock_edit, mock_container_index):
100+
mock_edit.return_value = {"state": "EDITED"}
101101
mock_inference = MagicMock()
102102
mock_inference.values.return_value = [
103103
MagicMock(family="odsc-vllm-serving"),
@@ -113,10 +113,12 @@ def test_put(self,mock_edit,mock_container_index):
113113
inference_container="odsc-tgi-serving",
114114
)
115115
)
116-
with patch("ads.aqua.extension.base_handler.AquaAPIhandler.finish") as mock_finish:
116+
with patch(
117+
"ads.aqua.extension.base_handler.AquaAPIhandler.finish"
118+
) as mock_finish:
117119
mock_finish.side_effect = lambda x: x
118120
result = self.model_handler.put(id="ocid1.datasciencemodel.oc1.iad.xxx")
119-
print(f"result: ",result)
121+
print(f"result: ", result)
120122
assert result["state"] is "EDITED"
121123
mock_edit.assert_called()
122124

0 commit comments

Comments
 (0)