@@ -99,7 +99,7 @@ def test_pipeline_create_and_update_with_config_injection(sagemaker_session_mock
99
99
RoleArn = pipeline_role_arn ,
100
100
)
101
101
pipeline .upsert ()
102
- assert sagemaker_session_mock .sagemaker_client .update_pipeline .called_with (
102
+ sagemaker_session_mock .sagemaker_client .update_pipeline .assert_called_with (
103
103
PipelineName = "MyPipeline" ,
104
104
PipelineDefinition = pipeline .definition (),
105
105
RoleArn = pipeline_role_arn ,
@@ -130,7 +130,7 @@ def test_pipeline_create_with_parallelism_config(sagemaker_session_mock, role_ar
130
130
role_arn = role_arn ,
131
131
parallelism_config = dict (MaxParallelExecutionSteps = 10 ),
132
132
)
133
- assert sagemaker_session_mock .sagemaker_client .create_pipeline .called_with (
133
+ sagemaker_session_mock .sagemaker_client .create_pipeline .assert_called_with (
134
134
PipelineName = "MyPipeline" ,
135
135
PipelineDefinition = pipeline .definition (),
136
136
RoleArn = role_arn ,
@@ -149,7 +149,7 @@ def test_pipeline_create_and_start_with_parallelism_config(sagemaker_session_moc
149
149
role_arn = role_arn ,
150
150
parallelism_config = dict (MaxParallelExecutionSteps = 10 ),
151
151
)
152
- assert sagemaker_session_mock .sagemaker_client .create_pipeline .called_with (
152
+ sagemaker_session_mock .sagemaker_client .create_pipeline .assert_called_with (
153
153
PipelineName = "MyPipeline" ,
154
154
PipelineDefinition = pipeline .definition (),
155
155
RoleArn = role_arn ,
@@ -209,7 +209,7 @@ def test_pipeline_update(sagemaker_session_mock, role_arn):
209
209
assert not pipeline .steps
210
210
pipeline .update (role_arn = role_arn )
211
211
assert len (json .loads (pipeline .definition ())["Steps" ]) == 0
212
- assert sagemaker_session_mock .sagemaker_client .update_pipeline .called_with (
212
+ sagemaker_session_mock .sagemaker_client .update_pipeline .assert_called_with (
213
213
PipelineName = "MyPipeline" , PipelineDefinition = pipeline .definition (), RoleArn = role_arn
214
214
)
215
215
@@ -345,7 +345,7 @@ def test_pipeline_update_with_parallelism_config(sagemaker_session_mock, role_ar
345
345
role_arn = role_arn ,
346
346
parallelism_config = dict (MaxParallelExecutionSteps = 10 ),
347
347
)
348
- assert sagemaker_session_mock .sagemaker_client .update_pipeline .called_with (
348
+ sagemaker_session_mock .sagemaker_client .update_pipeline .assert_called_with (
349
349
PipelineName = "MyPipeline" ,
350
350
PipelineDefinition = pipeline .definition (),
351
351
RoleArn = role_arn ,
@@ -418,7 +418,7 @@ def _raise_does_already_exists_client_error(**kwargs):
418
418
sagemaker_session_mock .sagemaker_client .update_pipeline .assert_called_once_with (
419
419
PipelineName = "MyPipeline" , PipelineDefinition = pipeline .definition (), RoleArn = role_arn
420
420
)
421
- assert sagemaker_session_mock .sagemaker_client .list_tags .called_with (
421
+ sagemaker_session_mock .sagemaker_client .list_tags .assert_called_with (
422
422
ResourceArn = "mock_pipeline_arn"
423
423
)
424
424
@@ -523,7 +523,7 @@ def test_pipeline_delete(sagemaker_session_mock):
523
523
sagemaker_session = sagemaker_session_mock ,
524
524
)
525
525
pipeline .delete ()
526
- assert sagemaker_session_mock .sagemaker_client .delete_pipeline .called_with (
526
+ sagemaker_session_mock .sagemaker_client .delete_pipeline .assert_called_with (
527
527
PipelineName = "MyPipeline" ,
528
528
)
529
529
@@ -536,7 +536,7 @@ def test_pipeline_describe(sagemaker_session_mock):
536
536
sagemaker_session = sagemaker_session_mock ,
537
537
)
538
538
pipeline .describe ()
539
- assert sagemaker_session_mock .sagemaker_client .describe_pipeline .called_with (
539
+ sagemaker_session_mock .sagemaker_client .describe_pipeline .assert_called_with (
540
540
PipelineName = "MyPipeline" ,
541
541
)
542
542
@@ -552,7 +552,7 @@ def test_pipeline_start(sagemaker_session_mock):
552
552
sagemaker_session = sagemaker_session_mock ,
553
553
)
554
554
pipeline .start ()
555
- assert sagemaker_session_mock .start_pipeline_execution .called_with (
555
+ sagemaker_session_mock .start_pipeline_execution .assert_called_with (
556
556
PipelineName = "MyPipeline" ,
557
557
)
558
558
@@ -821,10 +821,8 @@ def test_pipeline_build_parameters_from_execution(sagemaker_session_mock):
821
821
pipeline_execution_arn = reference_execution_arn ,
822
822
parameter_value_overrides = parameter_value_overrides ,
823
823
)
824
- assert (
825
- sagemaker_session_mock .sagemaker_client .list_pipeline_parameters_for_execution .called_with (
826
- PipelineExecutionArn = reference_execution_arn
827
- )
824
+ sagemaker_session_mock .sagemaker_client .list_pipeline_parameters_for_execution .assert_called_with (
825
+ PipelineExecutionArn = reference_execution_arn
828
826
)
829
827
assert len (parameters ) == 1
830
828
assert parameters ["TestParameterName" ] == "NewParameterValue"
@@ -850,10 +848,8 @@ def test_pipeline_build_parameters_from_execution_with_invalid_overrides(sagemak
850
848
+ f"are not present in the pipeline execution: { reference_execution_arn } "
851
849
in str (error )
852
850
)
853
- assert (
854
- sagemaker_session_mock .sagemaker_client .list_pipeline_parameters_for_execution .called_with (
855
- PipelineExecutionArn = reference_execution_arn
856
- )
851
+ sagemaker_session_mock .sagemaker_client .list_pipeline_parameters_for_execution .assert_called_with (
852
+ PipelineExecutionArn = reference_execution_arn
857
853
)
858
854
859
855
@@ -912,7 +908,7 @@ def test_pipeline_execution_basics(sagemaker_session_mock):
912
908
PipelineExecutionArn = "my:arn"
913
909
)
914
910
execution .describe ()
915
- assert sagemaker_session_mock .sagemaker_client .describe_pipeline_execution .called_with (
911
+ sagemaker_session_mock .sagemaker_client .describe_pipeline_execution .assert_called_with (
916
912
PipelineExecutionArn = "my:arn"
917
913
)
918
914
steps = execution .list_steps ()
0 commit comments