@@ -122,14 +122,14 @@ def test_api_path(self):
122122 organization , project , cluster , appService ,
123123 self .expected_res ["name" ], self .expected_res ["deltaSync" ],
124124 self .expected_res ["bucket" ], self .expected_res ["scopes" ],
125- self .expected_res ["userXattrKey" ])
125+ self .expected_res ["userXattrKey" ], self . expected_res [ "cors" ] )
126126 if result .status_code == 429 :
127127 self .handle_rate_limit (int (result .headers ["Retry-After" ]))
128128 result = self .capellaAPI .cluster_ops_apis .create_app_endpoint (
129129 organization , project , cluster , appService ,
130130 self .expected_res ["name" ], self .expected_res ["deltaSync" ],
131131 self .expected_res ["bucket" ], self .expected_res ["scopes" ],
132- self .expected_res ["userXattrKey" ])
132+ self .expected_res ["userXattrKey" ], self . expected_res [ "cors" ] )
133133 self .capellaAPI .cluster_ops_apis .app_endpoints_endpoint = \
134134 "/v4/organizations/{}/projects/{}/clusters/{}/appservices/{}/" \
135135 "appEndpoints"
@@ -146,26 +146,28 @@ def test_api_path(self):
146146 def test_authorization (self ):
147147 failures = list ()
148148 for testcase in self .v4_RBAC_injection_init ([
149- "organizationOwner" , "projectOwner" , "projectManager"
149+ "organizationOwner" , "projectOwner" , "projectManager"
150150 ]):
151151 self .log .info ("Executing test: {}" .format (testcase ["description" ]))
152152 header = dict ()
153153 self .auth_test_setup (testcase , failures , header ,
154154 self .project_id , self .other_project_id )
155155 result = self .capellaAPI .cluster_ops_apis .create_app_endpoint (
156- self .organisation_id , self .project_id , self .cluster_id ,
156+ self .organisation_id , self .project_id , self .cluster_id ,
157157 self .app_service_id ,
158158 self .expected_res ["name" ], self .expected_res ["deltaSync" ],
159159 self .expected_res ["bucket" ], self .expected_res ["scopes" ],
160- self .expected_res ["userXattrKey" ], header )
160+ self .expected_res ["userXattrKey" ],
161+ self .expected_res ["cors" ], header )
161162 if result .status_code == 429 :
162163 self .handle_rate_limit (int (result .headers ["Retry-After" ]))
163164 result = self .capellaAPI .cluster_ops_apis .create_app_endpoint (
164- self .organisation_id , self .project_id , self .cluster_id ,
165+ self .organisation_id , self .project_id , self .cluster_id ,
165166 self .app_service_id ,
166167 self .expected_res ["name" ], self .expected_res ["deltaSync" ],
167168 self .expected_res ["bucket" ], self .expected_res ["scopes" ],
168169 self .expected_res ["userXattrKey" ],
170+ self .expected_res ["cors" ],
169171 header )
170172 self .validate_testcase (result , [201 , 412 ], testcase , failures )
171173 if result .status_code == 201 :
@@ -178,10 +180,10 @@ def test_authorization(self):
178180
179181 def test_query_parameters (self ):
180182 self .log .debug (
181- "Correct Params - organization ID: {}, project ID: {}, "
182- "cluster ID: {}, appService ID: {}" .format (
183- self .organisation_id , self .project_id , self .cluster_id ,
184- self .app_service_id ))
183+ "Correct Params - organization ID: {}, project ID: {}, "
184+ "cluster ID: {}, appService ID: {}" .format (
185+ self .organisation_id , self .project_id , self .cluster_id ,
186+ self .app_service_id ))
185187 testcases = 0
186188 failures = list ()
187189 for combination in self .create_path_combinations (
@@ -210,10 +212,10 @@ def test_query_parameters(self):
210212 testcase ["expected_status_code" ] = 405
211213 testcase ["expected_error" ] = ""
212214 elif any (variable in [
213- int , bool , float , list , tuple , set , type (None )] for
214- variable in [
215- type (combination [0 ]), type (combination [1 ]),
216- type (combination [2 ]), type (combination [3 ])]):
215+ int , bool , float , list , tuple , set , type (None )] for
216+ variable in [
217+ type (combination [0 ]), type (combination [1 ]),
218+ type (combination [2 ]), type (combination [3 ])]):
217219 testcase ["expected_status_code" ] = 400
218220 testcase ["expected_error" ] = {
219221 "code" : 1000 ,
@@ -299,7 +301,8 @@ def test_query_parameters(self):
299301 testcase ["clusterID" ], testcase ["appServiceID" ],
300302 self .expected_res ["name" ], self .expected_res ["deltaSync" ],
301303 self .expected_res ["bucket" ], self .expected_res ["scopes" ],
302- self .expected_res ["userXattrKey" ], ** kwarg )
304+ self .expected_res ["userXattrKey" ], self .expected_res ["cors" ],
305+ ** kwarg )
303306 if result .status_code == 429 :
304307 self .handle_rate_limit (int (result .headers ["Retry-After" ]))
305308 result = self .capellaAPI .cluster_ops_apis .create_app_endpoint (
@@ -308,6 +311,7 @@ def test_query_parameters(self):
308311 self .expected_res ["name" ], self .expected_res ["deltaSync" ],
309312 self .expected_res ["bucket" ], self .expected_res ["scopes" ],
310313 self .expected_res ["userXattrKey" ],
314+ self .expected_res ["cors" ],
311315 ** kwarg )
312316 self .validate_testcase (result , [201 , 412 ], testcase , failures )
313317 if result .status_code == 201 :
@@ -322,7 +326,7 @@ def test_query_parameters(self):
322326 def test_payload (self ):
323327 testcases = list ()
324328 for k in self .expected_res :
325- if k in ["offline" , "anonymous" , "basicAuth" , "oidc" , "cors" ,
329+ if k in ["offline" , "anonymous" , "basicAuth" , "oidc" ,
326330 "isRequireResync" , "console" , "state" , "requireResync" ]:
327331 continue
328332
@@ -353,8 +357,8 @@ def test_payload(self):
353357 elif (k in [
354358 "userXattrKey" , "name" , "bucket"
355359 ] and not isinstance (v , str ) or
356- k == "deltaSync" and not isinstance (v , bool ) or
357- k == "scopes" and not isinstance (v , dict )):
360+ k == "deltaSync" and not isinstance (v , bool ) or
361+ k == "scopes" and not isinstance (v , dict )):
358362 testcase ["expected_status_code" ] = 400
359363 testcase ["expected_error" ] = {
360364 "code" : 1000 ,
@@ -429,15 +433,15 @@ def test_payload(self):
429433 self .organisation_id , self .project_id , self .cluster_id ,
430434 self .app_service_id , testcase ["name" ], testcase ["deltaSync" ],
431435 testcase ["bucket" ], testcase ["scopes" ],
432- testcase ["userXattrKey" ])
436+ testcase ["userXattrKey" ], self . expected_res [ "cors" ] )
433437 if res .status_code == 429 :
434438 self .handle_rate_limit (int (res .headers ["Retry-After" ]))
435439 res = self .capellaAPI .cluster_ops_apis .create_bucket (
436440 self .organisation_id , self .project_id ,
437441 self .cluster_id , self .app_service_id ,
438442 testcase ["name" ], testcase ["deltaSync" ],
439443 testcase ["bucket" ], testcase ["scopes" ],
440- testcase ["userXattrKey" ])
444+ testcase ["userXattrKey" ], self . expected_res [ "cors" ] )
441445 self .validate_testcase (res , [201 , 412 ], testcase , failures ,
442446 payloadTest = True )
443447 if res .status_code == 201 :
0 commit comments