18
18
from sagemaker .workflow .emr_step import (
19
19
EMRStep ,
20
20
EMRStepConfig ,
21
- err_str_with_name_auto_termination_or_steps ,
22
- err_str_without_instance ,
23
- err_str_with_keepjobflow_or_terminationprotected ,
24
- err_str_both_or_none_instancegroups_or_instancefleets ,
25
- err_str_with_both_cluster_id_and_cluster_cfg ,
26
- err_str_without_cluster_id_and_cluster_cfg ,
21
+ ERR_STR_WITH_NAME_AUTO_TERMINATION_OR_STEPS ,
22
+ ERR_STR_WITHOUT_INSTANCE ,
23
+ ERR_STR_WITH_KEEPJOBFLOW_OR_TERMINATIONPROTECTED ,
24
+ ERR_STR_BOTH_OR_NONE_INSTANCEGROUPS_OR_INSTANCEFLEETS ,
25
+ ERR_STR_WITH_BOTH_CLUSTER_ID_AND_CLUSTER_CFG ,
26
+ ERR_STR_WITHOUT_CLUSTER_ID_AND_CLUSTER_CFG ,
27
27
)
28
28
from sagemaker .workflow .steps import CacheConfig
29
29
from sagemaker .workflow .pipeline import Pipeline , PipelineGraph
@@ -212,7 +212,7 @@ def test_emr_step_throws_exception_when_both_cluster_id_and_cluster_config_are_p
212
212
depends_on = ["TestStep" ],
213
213
cache_config = CacheConfig (enable_caching = True , expire_after = "PT1H" ),
214
214
)
215
- expected_error_msg = err_str_with_both_cluster_id_and_cluster_cfg .format (
215
+ expected_error_msg = ERR_STR_WITH_BOTH_CLUSTER_ID_AND_CLUSTER_CFG .format (
216
216
step_name = g_emr_step_name
217
217
)
218
218
actual_error_msg = exceptionInfo .value .args [0 ]
@@ -231,7 +231,7 @@ def test_emr_step_throws_exception_when_both_cluster_id_and_cluster_config_are_n
231
231
depends_on = ["TestStep" ],
232
232
cache_config = CacheConfig (enable_caching = True , expire_after = "PT1H" ),
233
233
)
234
- expected_error_msg = err_str_without_cluster_id_and_cluster_cfg .format (
234
+ expected_error_msg = ERR_STR_WITHOUT_CLUSTER_ID_AND_CLUSTER_CFG .format (
235
235
step_name = g_emr_step_name
236
236
)
237
237
actual_error_msg = exceptionInfo .value .args [0 ]
@@ -334,7 +334,7 @@ def test_emr_step_with_valid_cluster_config():
334
334
],
335
335
},
336
336
},
337
- err_str_with_name_auto_termination_or_steps .format (step_name = g_emr_step_name ),
337
+ ERR_STR_WITH_NAME_AUTO_TERMINATION_OR_STEPS .format (step_name = g_emr_step_name ),
338
338
),
339
339
(
340
340
{
@@ -347,7 +347,7 @@ def test_emr_step_with_valid_cluster_config():
347
347
],
348
348
},
349
349
},
350
- err_str_with_name_auto_termination_or_steps .format (step_name = g_emr_step_name ),
350
+ ERR_STR_WITH_NAME_AUTO_TERMINATION_OR_STEPS .format (step_name = g_emr_step_name ),
351
351
),
352
352
(
353
353
{
@@ -360,20 +360,20 @@ def test_emr_step_with_valid_cluster_config():
360
360
],
361
361
},
362
362
},
363
- err_str_with_name_auto_termination_or_steps .format (step_name = g_emr_step_name ),
363
+ ERR_STR_WITH_NAME_AUTO_TERMINATION_OR_STEPS .format (step_name = g_emr_step_name ),
364
364
),
365
365
(
366
366
{
367
367
"AmiVersion" : "3.8.0" ,
368
368
"AdditionalInfo" : "MyAdditionalInfo" ,
369
369
},
370
- err_str_without_instance .format (step_name = g_emr_step_name ),
370
+ ERR_STR_WITHOUT_INSTANCE .format (step_name = g_emr_step_name ),
371
371
),
372
372
(
373
373
{
374
374
"Instances" : {},
375
375
},
376
- err_str_both_or_none_instancegroups_or_instancefleets .format (step_name = g_emr_step_name ),
376
+ ERR_STR_BOTH_OR_NONE_INSTANCEGROUPS_OR_INSTANCEFLEETS .format (step_name = g_emr_step_name ),
377
377
),
378
378
(
379
379
{
@@ -390,7 +390,7 @@ def test_emr_step_with_valid_cluster_config():
390
390
],
391
391
},
392
392
},
393
- err_str_both_or_none_instancegroups_or_instancefleets .format (step_name = g_emr_step_name ),
393
+ ERR_STR_BOTH_OR_NONE_INSTANCEGROUPS_OR_INSTANCEFLEETS .format (step_name = g_emr_step_name ),
394
394
),
395
395
(
396
396
{
@@ -403,7 +403,7 @@ def test_emr_step_with_valid_cluster_config():
403
403
"KeepJobFlowAliveWhenNoSteps" : True ,
404
404
},
405
405
},
406
- err_str_with_keepjobflow_or_terminationprotected .format (step_name = g_emr_step_name ),
406
+ ERR_STR_WITH_KEEPJOBFLOW_OR_TERMINATIONPROTECTED .format (step_name = g_emr_step_name ),
407
407
),
408
408
(
409
409
{
@@ -416,7 +416,7 @@ def test_emr_step_with_valid_cluster_config():
416
416
"TerminationProtected" : True ,
417
417
},
418
418
},
419
- err_str_with_keepjobflow_or_terminationprotected .format (step_name = g_emr_step_name ),
419
+ ERR_STR_WITH_KEEPJOBFLOW_OR_TERMINATIONPROTECTED .format (step_name = g_emr_step_name ),
420
420
),
421
421
],
422
422
)
0 commit comments