11
11
import unittest
12
12
import pandas
13
13
from unittest .mock import MagicMock , patch
14
- from ads .common import utils
15
14
from ads .common .oci_datascience import OCIDataScienceMixin
16
15
from ads .common .oci_logging import ConsolidatedLog , OCILog
17
16
from ads .common .oci_mixin import OCIModelMixin
23
22
ModelDeployment ,
24
23
ModelDeploymentLogType ,
25
24
ModelDeploymentFailedError ,
26
- MAX_ARTIFACT_SIZE_IN_BYTES ,
27
25
)
28
26
from ads .model .deployment .model_deployment_infrastructure import (
29
27
ModelDeploymentInfrastructure ,
@@ -1390,10 +1388,8 @@ def test_model_deployment_with_subnet_id(self):
1390
1388
"create_model_deployment" ,
1391
1389
)
1392
1390
@patch .object (DataScienceModel , "create" )
1393
- @patch .object (utils , "folder_size" )
1394
1391
def test_model_deployment_with_large_size_artifact (
1395
1392
self ,
1396
- mock_folder_size ,
1397
1393
mock_create ,
1398
1394
mock_create_model_deployment ,
1399
1395
mock_sync
@@ -1409,6 +1405,7 @@ def test_model_deployment_with_large_size_artifact(
1409
1405
.with_overwrite_existing_artifact (True )
1410
1406
.with_remove_existing_artifact (True )
1411
1407
.with_timeout (100 )
1408
+ .with_bucket_uri ("test_bucket_uri" )
1412
1409
)
1413
1410
1414
1411
runtime_dict = model_deployment .runtime .to_dict ()["spec" ]
@@ -1417,20 +1414,14 @@ def test_model_deployment_with_large_size_artifact(
1417
1414
assert runtime_dict ["overwriteExistingArtifact" ] == True
1418
1415
assert runtime_dict ["removeExistingArtifact" ] == True
1419
1416
assert runtime_dict ["timeout" ] == 100
1417
+ assert runtime_dict ["bucketUri" ] == "test_bucket_uri"
1420
1418
1421
1419
response = MagicMock ()
1422
1420
response .data = OCI_MODEL_DEPLOYMENT_RESPONSE
1423
1421
mock_create_model_deployment .return_value = response
1424
1422
model_deployment = self .initialize_model_deployment ()
1425
1423
model_deployment .set_spec (model_deployment .CONST_ID , "test_model_deployment_id" )
1426
1424
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"
1434
1425
create_model_deployment_details = (
1435
1426
model_deployment ._build_model_deployment_details ()
1436
1427
)
0 commit comments