Skip to content

Commit 07dc35b

Browse files
committed
fixed some unit test issues
1 parent aa23f25 commit 07dc35b

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

tests/unitary/with_extras/model/test_generic_model.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@
4040
from ads.model.deployment.common.utils import State as ModelDeploymentState
4141
from ads.model.generic_model import (
4242
_ATTRIBUTES_TO_SHOW_,
43+
ArtifactsNotAvailableError,
4344
GenericModel,
4445
NotActiveDeploymentError,
45-
ArtifactsNotAvailableError,
4646
SummaryStatus,
4747
_prepare_artifact_dir,
4848
)
@@ -165,7 +165,7 @@
165165

166166
INFERENCE_CONDA_ENV = "oci://bucket@namespace/<path_to_service_pack>"
167167
TRAINING_CONDA_ENV = "oci://bucket@namespace/<path_to_service_pack>"
168-
DEFAULT_PYTHON_VERSION = "3.8"
168+
DEFAULT_PYTHON_VERSION = "3.12"
169169
MODEL_FILE_NAME = "fake_model_name"
170170
FAKE_MD_URL = "http://<model-deployment-url>"
171171

@@ -257,7 +257,8 @@ def test__handle_model_file_name_raise_error(self):
257257
def test_prepare(self, mock_signer):
258258
"""prepare a trained model."""
259259
self.generic_model.prepare(
260-
"oci://service-conda-packs@ociodscdev/service_pack/cpu/General_Machine_Learning_for_CPUs/1.0/mlcpuv1",
260+
inference_conda_env="oci://service-conda-packs@ociodscdev/service_pack/cpu/General_Machine_Learning_for_CPUs/1.0/mlcpuv1",
261+
inference_python_version=DEFAULT_PYTHON_VERSION,
261262
model_file_name="fake_model_name",
262263
)
263264

@@ -1449,7 +1450,8 @@ def test__to_dict_not_prepared(self):
14491450
@patch("ads.common.auth.default_signer")
14501451
def test__to_dict_prepared(self, moxk_signer):
14511452
self.generic_model.prepare(
1452-
"oci://service-conda-packs@ociodscdev/service_pack/cpu/General_Machine_Learning_for_CPUs/1.0/mlcpuv1"
1453+
inference_conda_env="oci://service-conda-packs@ociodscdev/service_pack/cpu/General_Machine_Learning_for_CPUs/1.0/mlcpuv1",
1454+
inference_python_version=DEFAULT_PYTHON_VERSION
14531455
)
14541456
dictionary = self.generic_model._to_dict()
14551457
for key in _ATTRIBUTES_TO_SHOW_:
@@ -2255,7 +2257,7 @@ class TestCommonMethods:
22552257
def test__prepare_artifact_dir(
22562258
self, mock_signer, mock_mkdtemp, test_value, expected_value
22572259
):
2258-
"""Ensures that artifact dir name can be benerated propertly."""
2260+
"""Ensures that artifact dir name can be generated propertly."""
22592261

22602262
assert (
22612263
_prepare_artifact_dir(test_value) == expected_value

0 commit comments

Comments
 (0)