@@ -64,7 +64,7 @@ def mock_get_container_config():
6464 yield mock_config
6565
6666
67- @pytest .fixture (autouse = True , scope = "class " )
67+ @pytest .fixture (autouse = True , scope = "function " )
6868def mock_get_hf_model_info ():
6969 with patch .object (HfApi , "model_info" ) as mock_get_hf_model_info :
7070 test_hf_model_info = ModelInfo (
@@ -933,7 +933,7 @@ def test_import_model_with_missing_config(
933933 app .list = MagicMock (return_value = [])
934934
935935 if download_from_hf :
936- with pytest .raises (AquaValueError ):
936+ with pytest .raises (AquaRuntimeError ):
937937 mock_get_hf_model_info .return_value .siblings = []
938938 with tempfile .TemporaryDirectory () as tmpdir :
939939 model : AquaModel = app .register (
@@ -1037,7 +1037,11 @@ def test_import_tei_model_byoc(
10371037 DataScienceModel .sync = MagicMock ()
10381038 OCIDataScienceModel .create = MagicMock ()
10391039
1040- mock_list_objects .return_value = MagicMock (objects = [])
1040+ artifact_path = "service_models/model-name/commit-id/artifact"
1041+ obj1 = MagicMock (etag = "12345-1234-1234-1234-123456789" , size = 150 )
1042+ obj1 .name = f"{ artifact_path } /config.json"
1043+ objects = [obj1 ]
1044+ mock_list_objects .return_value = MagicMock (objects = objects )
10411045 ds_model = DataScienceModel ()
10421046 os_path = "oci://aqua-bkt@aqua-ns/prefix/path"
10431047 model_name = "oracle/aqua-1t-mega-model"
0 commit comments