1111import unittest
1212import pandas
1313from unittest .mock import MagicMock , patch
14- from ads .common import utils
1514from ads .common .oci_datascience import OCIDataScienceMixin
1615from ads .common .oci_logging import ConsolidatedLog , OCILog
1716from ads .common .oci_mixin import OCIModelMixin
2322 ModelDeployment ,
2423 ModelDeploymentLogType ,
2524 ModelDeploymentFailedError ,
26- MAX_ARTIFACT_SIZE_IN_BYTES ,
2725)
2826from ads .model .deployment .model_deployment_infrastructure import (
2927 ModelDeploymentInfrastructure ,
@@ -1390,10 +1388,8 @@ def test_model_deployment_with_subnet_id(self):
13901388 "create_model_deployment" ,
13911389 )
13921390 @patch .object (DataScienceModel , "create" )
1393- @patch .object (utils , "folder_size" )
13941391 def test_model_deployment_with_large_size_artifact (
13951392 self ,
1396- mock_folder_size ,
13971393 mock_create ,
13981394 mock_create_model_deployment ,
13991395 mock_sync
@@ -1409,6 +1405,7 @@ def test_model_deployment_with_large_size_artifact(
14091405 .with_overwrite_existing_artifact (True )
14101406 .with_remove_existing_artifact (True )
14111407 .with_timeout (100 )
1408+ .with_bucket_uri ("test_bucket_uri" )
14121409 )
14131410
14141411 runtime_dict = model_deployment .runtime .to_dict ()["spec" ]
@@ -1417,20 +1414,14 @@ def test_model_deployment_with_large_size_artifact(
14171414 assert runtime_dict ["overwriteExistingArtifact" ] == True
14181415 assert runtime_dict ["removeExistingArtifact" ] == True
14191416 assert runtime_dict ["timeout" ] == 100
1417+ assert runtime_dict ["bucketUri" ] == "test_bucket_uri"
14201418
14211419 response = MagicMock ()
14221420 response .data = OCI_MODEL_DEPLOYMENT_RESPONSE
14231421 mock_create_model_deployment .return_value = response
14241422 model_deployment = self .initialize_model_deployment ()
14251423 model_deployment .set_spec (model_deployment .CONST_ID , "test_model_deployment_id" )
14261424
1427- mock_folder_size .return_value = MAX_ARTIFACT_SIZE_IN_BYTES + 1
1428- with pytest .raises (ValueError ):
1429- model_deployment .deploy (wait_for_completion = False )
1430-
1431- model_deployment .runtime .with_bucket_uri ("test_bucket_uri" )
1432- runtime_dict = model_deployment .runtime .to_dict ()["spec" ]
1433- assert runtime_dict ["bucketUri" ] == "test_bucket_uri"
14341425 create_model_deployment_details = (
14351426 model_deployment ._build_model_deployment_details ()
14361427 )
0 commit comments