@@ -317,7 +317,7 @@ def test_build_happy_path_with_sagemaker_endpoint_mode_and_byoc(
317317 )
318318
319319 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
321321 mock_model_obj
322322 if image_uri == mock_image_uri
323323 and image_config == MOCK_IMAGE_CONFIG
@@ -326,6 +326,7 @@ def test_build_happy_path_with_sagemaker_endpoint_mode_and_byoc(
326326 and role == mock_role_arn
327327 and env == ENV_VARS
328328 and sagemaker_session == mock_session
329+ and "model-name-" in name
329330 else None
330331 )
331332
@@ -425,13 +426,14 @@ def test_build_happy_path_with_sagemaker_endpoint_mode_and_1p_dlc_as_byoc(
425426 )
426427
427428 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
429430 mock_model_obj
430431 if image_uri == mock_1p_dlc_image_uri
431432 and model_data == model_data
432433 and role == mock_role_arn
433434 and env == ENV_VARS
434435 and sagemaker_session == mock_session
436+ and "model-name-" in name
435437 else None
436438 )
437439
@@ -532,13 +534,14 @@ def test_build_happy_path_with_sagemaker_endpoint_mode_and_inference_spec(
532534 )
533535
534536 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
536538 mock_model_obj
537539 if image_uri == mock_image_uri
538540 and model_data == model_data
539541 and role == mock_role_arn
540542 and env == ENV_VARS_INF_SPEC
541543 and sagemaker_session == mock_session
544+ and "model-name-" in name
542545 else None
543546 )
544547
@@ -633,13 +636,14 @@ def test_build_happy_path_with_sagemakerEndpoint_mode_and_model(
633636 )
634637
635638 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
637640 mock_model_obj
638641 if image_uri == mock_image_uri
639642 and model_data == model_data
640643 and role == mock_role_arn
641644 and env == ENV_VARS
642645 and sagemaker_session == mock_session
646+ and "model-name-" in name
643647 else None
644648 )
645649
@@ -742,13 +746,14 @@ def test_build_happy_path_with_sagemakerEndpoint_mode_and_xgboost_model(
742746 )
743747
744748 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
746750 mock_model_obj
747751 if image_uri == mock_image_uri
748752 and model_data == model_data
749753 and role == mock_role_arn
750754 and env == ENV_VARS
751755 and sagemaker_session == mock_session
756+ and "model-name-" in name
752757 else None
753758 )
754759
@@ -847,13 +852,14 @@ def test_build_happy_path_with_local_container_mode(
847852 mock_mode .prepare .side_effect = lambda : None
848853
849854 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
851856 mock_model_obj
852857 if image_uri == mock_image_uri
853858 and model_data is None
854859 and role == mock_role_arn
855860 and env == {}
856861 and sagemaker_session == mock_session
862+ and "model-name-" in name
857863 else None
858864 )
859865
@@ -968,13 +974,14 @@ def test_build_happy_path_with_localContainer_mode_overwritten_with_sagemaker_mo
968974 )
969975
970976 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
972978 mock_model_obj
973979 if image_uri == mock_image_uri
974980 and model_data is None
975981 and role == mock_role_arn
976982 and env == {}
977983 and sagemaker_session == mock_session
984+ and "model-name-" in name
978985 else None
979986 )
980987
@@ -1119,13 +1126,14 @@ def test_build_happy_path_with_sagemaker_endpoint_mode_overwritten_with_local_co
11191126 )
11201127
11211128 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
11231130 mock_model_obj
11241131 if image_uri == mock_image_uri
11251132 and model_data == model_data
11261133 and role == mock_role_arn
11271134 and env == ENV_VARS
11281135 and sagemaker_session == mock_session
1136+ and "model-name-" in name
11291137 else None
11301138 )
11311139
0 commit comments