|
46 | 46 | _client,
|
47 | 47 | api_invoke_url,
|
48 | 48 | create_rest_api,
|
| 49 | + create_rest_api_deployment, |
49 | 50 | create_rest_api_integration,
|
50 | 51 | create_rest_api_integration_response,
|
51 | 52 | create_rest_api_method_response,
|
52 | 53 | create_rest_resource,
|
53 | 54 | create_rest_resource_method,
|
54 | 55 | delete_rest_api,
|
| 56 | + update_rest_api_deployment, |
55 | 57 | )
|
56 | 58 | from tests.integration.awslambda.test_lambda_integration import TEST_STAGE_NAME
|
57 | 59 |
|
@@ -294,6 +296,48 @@ def test_api_gateway_sqs_integration(self):
|
294 | 296 | assert 1 == len(messages)
|
295 | 297 | assert test_data == json.loads(base64.b64decode(messages[0]["Body"]))
|
296 | 298 |
|
| 299 | + def test_update_rest_api_deployment(self, apigateway_client): |
| 300 | + api_id, _, root = create_rest_api(apigateway_client, name="aws lambda api") |
| 301 | + |
| 302 | + create_rest_resource_method( |
| 303 | + apigateway_client, |
| 304 | + restApiId=api_id, |
| 305 | + resourceId=root, |
| 306 | + httpMethod="GET", |
| 307 | + authorizationType="none", |
| 308 | + ) |
| 309 | + |
| 310 | + create_rest_api_integration( |
| 311 | + apigateway_client, |
| 312 | + restApiId=api_id, |
| 313 | + resourceId=root, |
| 314 | + httpMethod="GET", |
| 315 | + type="HTTP", |
| 316 | + uri="http://httpbin.org/robots.txt", |
| 317 | + integrationHttpMethod="POST", |
| 318 | + ) |
| 319 | + create_rest_api_integration_response( |
| 320 | + apigateway_client, |
| 321 | + restApiId=api_id, |
| 322 | + resourceId=root, |
| 323 | + httpMethod="GET", |
| 324 | + statusCode="200", |
| 325 | + selectionPattern="foobar", |
| 326 | + responseTemplates={}, |
| 327 | + ) |
| 328 | + |
| 329 | + deployment_id, _ = create_rest_api_deployment( |
| 330 | + apigateway_client, restApiId=api_id, description="my deployment" |
| 331 | + ) |
| 332 | + patch_operations = [{"op": "replace", "path": "/description", "value": "new-description"}] |
| 333 | + deployment = update_rest_api_deployment( |
| 334 | + apigateway_client, |
| 335 | + restApiId=api_id, |
| 336 | + deploymentId=deployment_id, |
| 337 | + patchOperations=patch_operations, |
| 338 | + ) |
| 339 | + assert deployment["description"] == "new-description" |
| 340 | + |
297 | 341 | def test_api_gateway_lambda_integration(self, apigateway_client, create_lambda_function):
|
298 | 342 | """
|
299 | 343 | API gateway to lambda integration test returns a response with the same body as the lambda function input.
|
|
0 commit comments