@@ -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 .assert_called_once_with (
102
+ assert 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 .assert_called_once_with (
133
+ assert 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 .assert_called_once_with (
152
+ assert sagemaker_session_mock .sagemaker_client .create_pipeline .assert_called_with (
153
153
PipelineName = "MyPipeline" ,
154
154
PipelineDefinition = pipeline .definition (),
155
155
RoleArn = role_arn ,
@@ -168,7 +168,7 @@ def test_pipeline_create_and_start_with_parallelism_config(sagemaker_session_moc
168
168
169
169
# Specify ParallelismConfiguration to another value which will be honored in backend
170
170
pipeline .start (parallelism_config = dict (MaxParallelExecutionSteps = 20 ))
171
- assert sagemaker_session_mock .sagemaker_client .start_pipeline_execution .assert_called_once_with (
171
+ assert sagemaker_session_mock .sagemaker_client .start_pipeline_execution .assert_called_with (
172
172
PipelineName = "MyPipeline" ,
173
173
ParallelismConfiguration = {"MaxParallelExecutionSteps" : 20 },
174
174
)
@@ -187,11 +187,11 @@ def test_large_pipeline_create(sagemaker_session_mock, role_arn):
187
187
188
188
pipeline .create (role_arn = role_arn )
189
189
190
- assert s3 .S3Uploader .upload_string_as_file_body .assert_called_once_with (
190
+ assert s3 .S3Uploader .upload_string_as_file_body .assert_called_with (
191
191
body = pipeline .definition (), s3_uri = "s3://s3_bucket/MyPipeline"
192
192
)
193
193
194
- assert sagemaker_session_mock .sagemaker_client .create_pipeline .assert_called_once_with (
194
+ assert sagemaker_session_mock .sagemaker_client .create_pipeline .assert_called_with (
195
195
PipelineName = "MyPipeline" ,
196
196
PipelineDefinitionS3Location = {"Bucket" : "s3_bucket" , "ObjectKey" : "MyPipeline" },
197
197
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 .assert_called_once_with (
212
+ assert sagemaker_session_mock .sagemaker_client .update_pipeline .assert_called_with (
213
213
PipelineName = "MyPipeline" , PipelineDefinition = pipeline .definition (), RoleArn = role_arn
214
214
)
215
215
@@ -253,7 +253,7 @@ def test_pipeline_update(sagemaker_session_mock, role_arn):
253
253
254
254
pipeline .update (role_arn = role_arn )
255
255
assert len (json .loads (pipeline .definition ())["Steps" ]) == 3
256
- assert sagemaker_session_mock .sagemaker_client .update_pipeline .assert_called_once_with (
256
+ assert sagemaker_session_mock .sagemaker_client .update_pipeline .assert_called_with (
257
257
PipelineName = "MyPipeline" , PipelineDefinition = pipeline .definition (), RoleArn = role_arn
258
258
)
259
259
@@ -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 .assert_called_once_with (
348
+ assert sagemaker_session_mock .sagemaker_client .update_pipeline .assert_called_with (
349
349
PipelineName = "MyPipeline" ,
350
350
PipelineDefinition = pipeline .definition (),
351
351
RoleArn = role_arn ,
@@ -366,11 +366,11 @@ def test_large_pipeline_update(sagemaker_session_mock, role_arn):
366
366
367
367
pipeline .create (role_arn = role_arn )
368
368
369
- assert s3 .S3Uploader .upload_string_as_file_body .assert_called_once_with (
369
+ assert s3 .S3Uploader .upload_string_as_file_body .assert_called_with (
370
370
body = pipeline .definition (), s3_uri = "s3://s3_bucket/MyPipeline"
371
371
)
372
372
373
- assert sagemaker_session_mock .sagemaker_client .update_pipeline .assert_called_once_with (
373
+ assert sagemaker_session_mock .sagemaker_client .update_pipeline .assert_called_with (
374
374
PipelineName = "MyPipeline" ,
375
375
PipelineDefinitionS3Location = {"Bucket" : "s3_bucket" , "ObjectKey" : "MyPipeline" },
376
376
RoleArn = role_arn ,
@@ -418,12 +418,12 @@ 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 .assert_called_once_with (
421
+ assert sagemaker_session_mock .sagemaker_client .list_tags .assert_called_with (
422
422
ResourceArn = "mock_pipeline_arn"
423
423
)
424
424
425
425
tags .append ({"Key" : "dummy" , "Value" : "dummy_tag" })
426
- assert sagemaker_session_mock .sagemaker_client .add_tags .assert_called_once_with (
426
+ assert sagemaker_session_mock .sagemaker_client .add_tags .assert_called_with (
427
427
ResourceArn = "mock_pipeline_arn" , Tags = tags
428
428
)
429
429
@@ -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 .assert_called_once_with (
526
+ assert 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 .assert_called_once_with (
539
+ assert sagemaker_session_mock .sagemaker_client .describe_pipeline .assert_called_with (
540
540
PipelineName = "MyPipeline" ,
541
541
)
542
542
@@ -552,17 +552,17 @@ 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 .assert_called_once_with (
555
+ assert sagemaker_session_mock .start_pipeline_execution .assert_called_with (
556
556
PipelineName = "MyPipeline" ,
557
557
)
558
558
559
559
pipeline .start (execution_display_name = "pipeline-execution" )
560
- assert sagemaker_session_mock .start_pipeline_execution .assert_called_once_with (
560
+ assert sagemaker_session_mock .start_pipeline_execution .assert_called_with (
561
561
PipelineName = "MyPipeline" , PipelineExecutionDisplayName = "pipeline-execution"
562
562
)
563
563
564
564
pipeline .start (parameters = dict (alpha = "epsilon" ))
565
- assert sagemaker_session_mock .start_pipeline_execution .assert_called_once_with (
565
+ assert sagemaker_session_mock .start_pipeline_execution .assert_called_with (
566
566
PipelineName = "MyPipeline" , PipelineParameters = [{"Name" : "alpha" , "Value" : "epsilon" }]
567
567
)
568
568
@@ -822,7 +822,7 @@ def test_pipeline_build_parameters_from_execution(sagemaker_session_mock):
822
822
parameter_value_overrides = parameter_value_overrides ,
823
823
)
824
824
assert (
825
- sagemaker_session_mock .sagemaker_client .list_pipeline_parameters_for_execution .assert_called_once_with (
825
+ sagemaker_session_mock .sagemaker_client .list_pipeline_parameters_for_execution .assert_called_with (
826
826
PipelineExecutionArn = reference_execution_arn
827
827
)
828
828
)
@@ -851,7 +851,7 @@ def test_pipeline_build_parameters_from_execution_with_invalid_overrides(sagemak
851
851
in str (error )
852
852
)
853
853
assert (
854
- sagemaker_session_mock .sagemaker_client .list_pipeline_parameters_for_execution .assert_called_once_with (
854
+ sagemaker_session_mock .sagemaker_client .list_pipeline_parameters_for_execution .assert_called_with (
855
855
PipelineExecutionArn = reference_execution_arn
856
856
)
857
857
)
@@ -908,21 +908,21 @@ def test_pipeline_execution_basics(sagemaker_session_mock):
908
908
)
909
909
execution = pipeline .start ()
910
910
execution .stop ()
911
- assert sagemaker_session_mock .sagemaker_client .stop_pipeline_execution .assert_called_once_with (
911
+ assert sagemaker_session_mock .sagemaker_client .stop_pipeline_execution .assert_called_with (
912
912
PipelineExecutionArn = "my:arn"
913
913
)
914
914
execution .describe ()
915
- assert sagemaker_session_mock .sagemaker_client .describe_pipeline_execution .assert_called_once_with (
915
+ assert sagemaker_session_mock .sagemaker_client .describe_pipeline_execution .assert_called_with (
916
916
PipelineExecutionArn = "my:arn"
917
917
)
918
918
steps = execution .list_steps ()
919
- assert sagemaker_session_mock .sagemaker_client .describe_pipeline_execution_steps .assert_called_once_with (
919
+ assert sagemaker_session_mock .sagemaker_client .describe_pipeline_execution_steps .assert_called_with (
920
920
PipelineExecutionArn = "my:arn"
921
921
)
922
922
assert len (steps ) == 1
923
923
list_parameters_response = execution .list_parameters ()
924
924
assert (
925
- sagemaker_session_mock .sagemaker_client .list_pipeline_parameters_for_execution .assert_called_once_with (
925
+ sagemaker_session_mock .sagemaker_client .list_pipeline_parameters_for_execution .assert_called_with (
926
926
PipelineExecutionArn = "my:arn"
927
927
)
928
928
)
0 commit comments