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