File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed
tests/unit/sagemaker/config Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change 192
192
"maxLength" : 256 ,
193
193
},
194
194
},
195
+ "required" : [KEY , VALUE ],
195
196
},
196
197
"minItems" : 0 ,
197
198
"maxItems" : 50 ,
Original file line number Diff line number Diff line change @@ -95,6 +95,26 @@ def test_valid_monitoring_schedule_schema(
95
95
)
96
96
97
97
98
+ def test_tags_with_invalid_schema (base_config_with_schema , valid_edge_packaging_config ):
99
+ edge_packaging_config = valid_edge_packaging_config .copy ()
100
+ edge_packaging_config ["Tags" ] = [{"Key" : "somekey" }]
101
+ config = base_config_with_schema
102
+ config ["SageMaker" ] = {"EdgePackagingJob" : edge_packaging_config }
103
+ with pytest .raises (exceptions .ValidationError ):
104
+ validate (config , SAGEMAKER_PYTHON_SDK_CONFIG_SCHEMA )
105
+ edge_packaging_config ["Tags" ] = [{"Value" : "somekey" }]
106
+ with pytest .raises (exceptions .ValidationError ):
107
+ validate (config , SAGEMAKER_PYTHON_SDK_CONFIG_SCHEMA )
108
+
109
+
110
+ def test_tags_with_valid_schema (base_config_with_schema , valid_edge_packaging_config ):
111
+ edge_packaging_config = valid_edge_packaging_config .copy ()
112
+ edge_packaging_config ["Tags" ] = [{"Key" : "somekey" , "Value" : "somevalue" }]
113
+ config = base_config_with_schema
114
+ config ["SageMaker" ] = {"EdgePackagingJob" : edge_packaging_config }
115
+ validate (config , SAGEMAKER_PYTHON_SDK_CONFIG_SCHEMA )
116
+
117
+
98
118
def test_invalid_training_job_schema (base_config_with_schema , valid_iam_role_arn , valid_vpc_config ):
99
119
# Changing key names
100
120
training_job_config = {
You can’t perform that action at this time.
0 commit comments