@@ -317,7 +317,7 @@ def test_build_happy_path_with_sagemaker_endpoint_mode_and_byoc(
317
317
)
318
318
319
319
mock_model_obj = Mock ()
320
- mock_sdk_model .side_effect = lambda image_uri , image_config , vpc_config , model_data , role , env , sagemaker_session , predictor_cls : ( # noqa E501
320
+ mock_sdk_model .side_effect = lambda image_uri , image_config , vpc_config , model_data , role , env , sagemaker_session , predictor_cls , name : ( # noqa E501
321
321
mock_model_obj
322
322
if image_uri == mock_image_uri
323
323
and image_config == MOCK_IMAGE_CONFIG
@@ -326,6 +326,7 @@ def test_build_happy_path_with_sagemaker_endpoint_mode_and_byoc(
326
326
and role == mock_role_arn
327
327
and env == ENV_VARS
328
328
and sagemaker_session == mock_session
329
+ and "model-name-" in name
329
330
else None
330
331
)
331
332
@@ -425,13 +426,14 @@ def test_build_happy_path_with_sagemaker_endpoint_mode_and_1p_dlc_as_byoc(
425
426
)
426
427
427
428
mock_model_obj = Mock ()
428
- mock_sdk_model .side_effect = lambda image_uri , image_config , vpc_config , model_data , role , env , sagemaker_session , predictor_cls : ( # noqa E501
429
+ mock_sdk_model .side_effect = lambda image_uri , image_config , vpc_config , model_data , role , env , sagemaker_session , predictor_cls , name : ( # noqa E501
429
430
mock_model_obj
430
431
if image_uri == mock_1p_dlc_image_uri
431
432
and model_data == model_data
432
433
and role == mock_role_arn
433
434
and env == ENV_VARS
434
435
and sagemaker_session == mock_session
436
+ and "model-name-" in name
435
437
else None
436
438
)
437
439
@@ -532,13 +534,14 @@ def test_build_happy_path_with_sagemaker_endpoint_mode_and_inference_spec(
532
534
)
533
535
534
536
mock_model_obj = Mock ()
535
- mock_sdk_model .side_effect = lambda image_uri , image_config , vpc_config , model_data , role , env , sagemaker_session , predictor_cls : ( # noqa E501
537
+ mock_sdk_model .side_effect = lambda image_uri , image_config , vpc_config , model_data , role , env , sagemaker_session , predictor_cls , name : ( # noqa E501
536
538
mock_model_obj
537
539
if image_uri == mock_image_uri
538
540
and model_data == model_data
539
541
and role == mock_role_arn
540
542
and env == ENV_VARS_INF_SPEC
541
543
and sagemaker_session == mock_session
544
+ and "model-name-" in name
542
545
else None
543
546
)
544
547
@@ -633,13 +636,14 @@ def test_build_happy_path_with_sagemakerEndpoint_mode_and_model(
633
636
)
634
637
635
638
mock_model_obj = Mock ()
636
- mock_sdk_model .side_effect = lambda image_uri , image_config , vpc_config , model_data , role , env , sagemaker_session , predictor_cls : ( # noqa E501
639
+ mock_sdk_model .side_effect = lambda image_uri , image_config , vpc_config , model_data , role , env , sagemaker_session , predictor_cls , name : ( # noqa E501
637
640
mock_model_obj
638
641
if image_uri == mock_image_uri
639
642
and model_data == model_data
640
643
and role == mock_role_arn
641
644
and env == ENV_VARS
642
645
and sagemaker_session == mock_session
646
+ and "model-name-" in name
643
647
else None
644
648
)
645
649
@@ -742,13 +746,14 @@ def test_build_happy_path_with_sagemakerEndpoint_mode_and_xgboost_model(
742
746
)
743
747
744
748
mock_model_obj = Mock ()
745
- mock_sdk_model .side_effect = lambda image_uri , image_config , vpc_config , model_data , role , env , sagemaker_session , predictor_cls : ( # noqa E501
749
+ mock_sdk_model .side_effect = lambda image_uri , image_config , vpc_config , model_data , role , env , sagemaker_session , predictor_cls , name : ( # noqa E501
746
750
mock_model_obj
747
751
if image_uri == mock_image_uri
748
752
and model_data == model_data
749
753
and role == mock_role_arn
750
754
and env == ENV_VARS
751
755
and sagemaker_session == mock_session
756
+ and "model-name-" in name
752
757
else None
753
758
)
754
759
@@ -847,13 +852,14 @@ def test_build_happy_path_with_local_container_mode(
847
852
mock_mode .prepare .side_effect = lambda : None
848
853
849
854
mock_model_obj = Mock ()
850
- mock_sdk_model .side_effect = lambda image_uri , image_config , vpc_config , model_data , role , env , sagemaker_session , predictor_cls : ( # noqa E501
855
+ mock_sdk_model .side_effect = lambda image_uri , image_config , vpc_config , model_data , role , env , sagemaker_session , predictor_cls , name : ( # noqa E501
851
856
mock_model_obj
852
857
if image_uri == mock_image_uri
853
858
and model_data is None
854
859
and role == mock_role_arn
855
860
and env == {}
856
861
and sagemaker_session == mock_session
862
+ and "model-name-" in name
857
863
else None
858
864
)
859
865
@@ -968,13 +974,14 @@ def test_build_happy_path_with_localContainer_mode_overwritten_with_sagemaker_mo
968
974
)
969
975
970
976
mock_model_obj = Mock ()
971
- mock_sdk_model .side_effect = lambda image_uri , image_config , vpc_config , model_data , role , env , sagemaker_session , predictor_cls : ( # noqa E501
977
+ mock_sdk_model .side_effect = lambda image_uri , image_config , vpc_config , model_data , role , env , sagemaker_session , predictor_cls , name : ( # noqa E501
972
978
mock_model_obj
973
979
if image_uri == mock_image_uri
974
980
and model_data is None
975
981
and role == mock_role_arn
976
982
and env == {}
977
983
and sagemaker_session == mock_session
984
+ and "model-name-" in name
978
985
else None
979
986
)
980
987
@@ -1119,13 +1126,14 @@ def test_build_happy_path_with_sagemaker_endpoint_mode_overwritten_with_local_co
1119
1126
)
1120
1127
1121
1128
mock_model_obj = Mock ()
1122
- mock_sdk_model .side_effect = lambda image_uri , image_config , vpc_config , model_data , role , env , sagemaker_session , predictor_cls : ( # noqa E501
1129
+ mock_sdk_model .side_effect = lambda image_uri , image_config , vpc_config , model_data , role , env , sagemaker_session , predictor_cls , name : ( # noqa E501
1123
1130
mock_model_obj
1124
1131
if image_uri == mock_image_uri
1125
1132
and model_data == model_data
1126
1133
and role == mock_role_arn
1127
1134
and env == ENV_VARS
1128
1135
and sagemaker_session == mock_session
1136
+ and "model-name-" in name
1129
1137
else None
1130
1138
)
1131
1139
0 commit comments