@@ -177,7 +177,7 @@ def test_build_happy_path_with_sagemaker_endpoint_mode_and_byoc(
177
177
mock_sageMakerEndpointMode .side_effect = lambda inference_spec , model_server : (
178
178
mock_mode if inference_spec is None and model_server == ModelServer .TORCHSERVE else None
179
179
)
180
- mock_mode .prepare .side_effect = lambda model_path , secret_key , s3_model_data_url , sagemaker_session , image_uri , jumpstart : (
180
+ mock_mode .prepare .side_effect = lambda model_path , secret_key , s3_model_data_url , sagemaker_session , image_uri , jumpstart : ( # noqa E501
181
181
(
182
182
model_data ,
183
183
ENV_VAR_PAIR ,
@@ -191,8 +191,8 @@ def test_build_happy_path_with_sagemaker_endpoint_mode_and_byoc(
191
191
)
192
192
193
193
mock_model_obj = Mock ()
194
- mock_sdk_model .side_effect = lambda image_uri , image_config , vpc_config , model_data , role , env , sagemaker_session , predictor_cls : (
195
- mock_model_obj # noqa E501
194
+ mock_sdk_model .side_effect = lambda image_uri , image_config , vpc_config , model_data , role , env , sagemaker_session , predictor_cls : ( # noqa E501
195
+ mock_model_obj
196
196
if image_uri == mock_image_uri
197
197
and image_config == MOCK_IMAGE_CONFIG
198
198
and vpc_config == MOCK_VPC_CONFIG
@@ -280,7 +280,7 @@ def test_build_happy_path_with_sagemaker_endpoint_mode_and_1p_dlc_as_byoc(
280
280
mock_sageMakerEndpointMode .side_effect = lambda inference_spec , model_server : (
281
281
mock_mode if inference_spec is None and model_server == ModelServer .TORCHSERVE else None
282
282
)
283
- mock_mode .prepare .side_effect = lambda model_path , secret_key , s3_model_data_url , sagemaker_session , image_uri , jumpstart : (
283
+ mock_mode .prepare .side_effect = lambda model_path , secret_key , s3_model_data_url , sagemaker_session , image_uri , jumpstart : ( # noqa E501
284
284
(
285
285
model_data ,
286
286
ENV_VAR_PAIR ,
@@ -294,8 +294,8 @@ def test_build_happy_path_with_sagemaker_endpoint_mode_and_1p_dlc_as_byoc(
294
294
)
295
295
296
296
mock_model_obj = Mock ()
297
- mock_sdk_model .side_effect = lambda image_uri , image_config , vpc_config , model_data , role , env , sagemaker_session , predictor_cls : (
298
- mock_model_obj # noqa E501
297
+ mock_sdk_model .side_effect = lambda image_uri , image_config , vpc_config , model_data , role , env , sagemaker_session , predictor_cls : ( # noqa E501
298
+ mock_model_obj
299
299
if image_uri == mock_1p_dlc_image_uri
300
300
and model_data == model_data
301
301
and role == mock_role_arn
@@ -387,7 +387,7 @@ def test_build_happy_path_with_sagemaker_endpoint_mode_and_inference_spec(
387
387
if inference_spec == mock_inference_spec and model_server == ModelServer .TORCHSERVE
388
388
else None
389
389
)
390
- mock_mode .prepare .side_effect = lambda model_path , secret_key , s3_model_data_url , sagemaker_session , image_uri , jumpstart : (
390
+ mock_mode .prepare .side_effect = lambda model_path , secret_key , s3_model_data_url , sagemaker_session , image_uri , jumpstart : ( # noqa E501
391
391
(
392
392
model_data ,
393
393
ENV_VAR_PAIR ,
@@ -401,8 +401,8 @@ def test_build_happy_path_with_sagemaker_endpoint_mode_and_inference_spec(
401
401
)
402
402
403
403
mock_model_obj = Mock ()
404
- mock_sdk_model .side_effect = lambda image_uri , image_config , vpc_config , model_data , role , env , sagemaker_session , predictor_cls : (
405
- mock_model_obj # noqa E501
404
+ mock_sdk_model .side_effect = lambda image_uri , image_config , vpc_config , model_data , role , env , sagemaker_session , predictor_cls : ( # noqa E501
405
+ mock_model_obj
406
406
if image_uri == mock_image_uri
407
407
and model_data == model_data
408
408
and role == mock_role_arn
@@ -483,7 +483,7 @@ def test_build_happy_path_with_sagemakerEndpoint_mode_and_model(
483
483
mock_sageMakerEndpointMode .side_effect = lambda inference_spec , model_server : (
484
484
mock_mode if inference_spec is None and model_server == ModelServer .TORCHSERVE else None
485
485
)
486
- mock_mode .prepare .side_effect = lambda model_path , secret_key , s3_model_data_url , sagemaker_session , image_uri , jumpstart : (
486
+ mock_mode .prepare .side_effect = lambda model_path , secret_key , s3_model_data_url , sagemaker_session , image_uri , jumpstart : ( # noqa E501
487
487
(
488
488
model_data ,
489
489
ENV_VAR_PAIR ,
@@ -497,8 +497,8 @@ def test_build_happy_path_with_sagemakerEndpoint_mode_and_model(
497
497
)
498
498
499
499
mock_model_obj = Mock ()
500
- mock_sdk_model .side_effect = lambda image_uri , image_config , vpc_config , model_data , role , env , sagemaker_session , predictor_cls : (
501
- mock_model_obj # noqa E501
500
+ mock_sdk_model .side_effect = lambda image_uri , image_config , vpc_config , model_data , role , env , sagemaker_session , predictor_cls : ( # noqa E501
501
+ mock_model_obj
502
502
if image_uri == mock_image_uri
503
503
and model_data == model_data
504
504
and role == mock_role_arn
@@ -587,7 +587,7 @@ def test_build_happy_path_with_sagemakerEndpoint_mode_and_xgboost_model(
587
587
mock_sageMakerEndpointMode .side_effect = lambda inference_spec , model_server : (
588
588
mock_mode if inference_spec is None and model_server == ModelServer .TORCHSERVE else None
589
589
)
590
- mock_mode .prepare .side_effect = lambda model_path , secret_key , s3_model_data_url , sagemaker_session , image_uri , jumpstart : (
590
+ mock_mode .prepare .side_effect = lambda model_path , secret_key , s3_model_data_url , sagemaker_session , image_uri , jumpstart : ( # noqa E501
591
591
(
592
592
model_data ,
593
593
ENV_VAR_PAIR ,
@@ -601,8 +601,8 @@ def test_build_happy_path_with_sagemakerEndpoint_mode_and_xgboost_model(
601
601
)
602
602
603
603
mock_model_obj = Mock ()
604
- mock_sdk_model .side_effect = lambda image_uri , image_config , vpc_config , model_data , role , env , sagemaker_session , predictor_cls : (
605
- mock_model_obj # noqa E501
604
+ mock_sdk_model .side_effect = lambda image_uri , image_config , vpc_config , model_data , role , env , sagemaker_session , predictor_cls : ( # noqa E501
605
+ mock_model_obj
606
606
if image_uri == mock_image_uri
607
607
and model_data == model_data
608
608
and role == mock_role_arn
@@ -706,8 +706,8 @@ def test_build_happy_path_with_local_container_mode(
706
706
mock_mode .prepare .side_effect = lambda : None
707
707
708
708
mock_model_obj = Mock ()
709
- mock_sdk_model .side_effect = lambda image_uri , image_config , vpc_config , model_data , role , env , sagemaker_session , predictor_cls : (
710
- mock_model_obj # noqa E501
709
+ mock_sdk_model .side_effect = lambda image_uri , image_config , vpc_config , model_data , role , env , sagemaker_session , predictor_cls : ( # noqa E501
710
+ mock_model_obj
711
711
if image_uri == mock_image_uri
712
712
and model_data is None
713
713
and role == mock_role_arn
@@ -813,7 +813,7 @@ def test_build_happy_path_with_localContainer_mode_overwritten_with_sagemaker_mo
813
813
if inference_spec == mock_inference_spec and model_server == ModelServer .TORCHSERVE
814
814
else None
815
815
)
816
- mock_sagemaker_endpoint_mode .prepare .side_effect = lambda model_path , secret_key , s3_model_data_url , sagemaker_session , image_uri , jumpstart : (
816
+ mock_sagemaker_endpoint_mode .prepare .side_effect = lambda model_path , secret_key , s3_model_data_url , sagemaker_session , image_uri , jumpstart : ( # noqa E501
817
817
(
818
818
model_data ,
819
819
ENV_VAR_PAIR ,
@@ -827,8 +827,8 @@ def test_build_happy_path_with_localContainer_mode_overwritten_with_sagemaker_mo
827
827
)
828
828
829
829
mock_model_obj = Mock ()
830
- mock_sdk_model .side_effect = lambda image_uri , image_config , vpc_config , model_data , role , env , sagemaker_session , predictor_cls : (
831
- mock_model_obj # noqa E501
830
+ mock_sdk_model .side_effect = lambda image_uri , image_config , vpc_config , model_data , role , env , sagemaker_session , predictor_cls : ( # noqa E501
831
+ mock_model_obj
832
832
if image_uri == mock_image_uri
833
833
and model_data is None
834
834
and role == mock_role_arn
@@ -935,7 +935,7 @@ def test_build_happy_path_with_sagemaker_endpoint_mode_overwritten_with_local_co
935
935
mock_sageMakerEndpointMode .side_effect = lambda inference_spec , model_server : (
936
936
mock_mode if inference_spec is None and model_server == ModelServer .TORCHSERVE else None
937
937
)
938
- mock_mode .prepare .side_effect = lambda model_path , secret_key , s3_model_data_url , sagemaker_session , image_uri , jumpstart : (
938
+ mock_mode .prepare .side_effect = lambda model_path , secret_key , s3_model_data_url , sagemaker_session , image_uri , jumpstart : ( # noqa E501
939
939
(
940
940
model_data ,
941
941
ENV_VAR_PAIR ,
@@ -973,8 +973,8 @@ def test_build_happy_path_with_sagemaker_endpoint_mode_overwritten_with_local_co
973
973
)
974
974
975
975
mock_model_obj = Mock ()
976
- mock_sdk_model .side_effect = lambda image_uri , image_config , vpc_config , model_data , role , env , sagemaker_session , predictor_cls : (
977
- mock_model_obj # noqa E501
976
+ mock_sdk_model .side_effect = lambda image_uri , image_config , vpc_config , model_data , role , env , sagemaker_session , predictor_cls : ( # noqa E501
977
+ mock_model_obj
978
978
if image_uri == mock_image_uri
979
979
and model_data == model_data
980
980
and role == mock_role_arn
0 commit comments