Skip to content

Commit 5560ff0

Browse files
committed
add missing transformers
1 parent 5a6da99 commit 5560ff0

File tree

3 files changed

+15
-7
lines changed

3 files changed

+15
-7
lines changed

tests/aws/services/apigateway/test_apigateway_basic.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1254,15 +1254,22 @@ def test_apigw_test_invoke_method_api(
12541254
),
12551255
snapshot.transform.regex(
12561256
r"Date=[a-zA-Z]{3},\s\d{2}\s[a-zA-Z]{3}\s\d{4}\s\d{2}:\d{2}:\d{2}\sGMT",
1257-
r"Date=Day, dd MMM yyyy hh:mm:ss GMT",
1257+
"Date=Day, dd MMM yyyy hh:mm:ss GMT",
12581258
),
12591259
snapshot.transform.regex(
1260-
r"x-amzn-RequestId=[a-f0-9-]{36}", r"x-amzn-RequestId=<request-id-lambda>"
1260+
r"x-amzn-RequestId=[a-f0-9-]{36}", "x-amzn-RequestId=<request-id-lambda>"
12611261
),
12621262
snapshot.transform.regex(
12631263
r"[a-zA-Z]{3}\s[a-zA-Z]{3}\s\d{2}\s\d{2}:\d{2}:\d{2}\sUTC\s\d{4} :",
1264-
r"DDD MMM dd hh:mm:ss UTC yyyy :",
1264+
"DDD MMM dd hh:mm:ss UTC yyyy :",
12651265
),
1266+
snapshot.transform.regex(
1267+
r"Authorization=.*?,", "Authorization=<authorization-header>,"
1268+
),
1269+
snapshot.transform.regex(
1270+
r"X-Amz-Security-Token=.*?\s\[", "X-Amz-Security-Token=<token> ["
1271+
),
1272+
snapshot.transform.regex(r"\d{8}T\d{6}Z", "<date>"),
12661273
]
12671274
)
12681275

@@ -1283,6 +1290,7 @@ def test_apigw_test_invoke_method_api(
12831290

12841291
# create REST API and test resource
12851292
rest_api_id, _, root = create_rest_apigw(name=f"test-{short_uid()}")
1293+
snapshot.add_transformer(snapshot.transform.regex(rest_api_id, "<rest-api-id>"))
12861294
resource = aws_client.apigateway.create_resource(
12871295
restApiId=rest_api_id, parentId=root, pathPart="foo"
12881296
)

tests/aws/services/apigateway/test_apigateway_basic.snapshot.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"tests/aws/services/apigateway/test_apigateway_basic.py::TestAPIGateway::test_apigw_test_invoke_method_api": {
3-
"recorded-date": "10-04-2025, 19:40:04",
3+
"recorded-date": "11-04-2025, 18:02:16",
44
"recorded-content": {
55
"test_invoke_method_response": {
66
"body": {
@@ -23,7 +23,7 @@
2323
"line05": "DDD MMM dd hh:mm:ss UTC yyyy : Method request headers: {}",
2424
"line06": "DDD MMM dd hh:mm:ss UTC yyyy : Method request body before transformations: ",
2525
"line07": "DDD MMM dd hh:mm:ss UTC yyyy : Endpoint request URI: https://<endpoint_url>/2015-03-31/functions/arn:<partition>:lambda:<region>:111111111111:function:<function-name>/invocations",
26-
"line08": "DDD MMM dd hh:mm:ss UTC yyyy : Endpoint request headers: {x-amzn-lambda-integration-tag=<request-id-1>, Authorization=*********************************************************************************************************************************************************************************************************************************************************************ca7606, X-Amz-Date=20250410T194004Z, x-amzn-apigateway-api-id=9tmlb8b101, Accept=application/json, User-Agent=AmazonAPIGateway_9tmlb8b101, X-Amz-Security-Token=IQoJb3JpZ2luX2VjEDQaCWV1LXdlc3QtMyJHMEUCIGhArE0d1b6khTa1VNnEYLGSGEdKirUtUpk4EcFQA2RWAiEA5rSnLQg1Dj7sEEeJt4j8skkzKqh2IU43diqRS/ZE0fgq7gIIrf//////////ARAAGgw2NzExMDc2Nzg0MTIiDKkWYgsnQ8xn9BzveSrCArA9qunrwSdEylofk8s22UEVNPdgJ+YcnRYDJ0/242R6Bu6CjLORoDmrGmYYlYhkH96ekamZw4jwZb1MaQTgVW+KIqkE+UiG5byM4Geq2uQWSmA+vAWAhJADh0lvzTlhYw7yQbBUq/obsbs8Jmp064RIY5IZYEHVinWfRkwyjL06i5r1DpYj7SCiaZCE18/JSLn02Rt1pnN6VhJwzadx/USf7B81kNNNntYE8akM+b+oxLFTYtG4jPEG3FmobaCrnJcC+eMNR4hkkFqaDd27lTzjhNV9/nPf0dr3Earg85OYOF [TRUNCATED]",
26+
"line08": "DDD MMM dd hh:mm:ss UTC yyyy : Endpoint request headers: {x-amzn-lambda-integration-tag=<request-id-1>, Authorization=<authorization-header>, X-Amz-Date=<date>, x-amzn-apigateway-api-id=<rest-api-id>, Accept=application/json, User-Agent=AmazonAPIGateway_<rest-api-id>, X-Amz-Security-Token=<token> [TRUNCATED]",
2727
"line09": "DDD MMM dd hh:mm:ss UTC yyyy : Endpoint request body after transformations: ",
2828
"line10": "DDD MMM dd hh:mm:ss UTC yyyy : Sending request to https://lambda.<region>.amazonaws.com/2015-03-31/functions/arn:<partition>:lambda:<region>:111111111111:function:<function-name>/invocations",
2929
"line11": "DDD MMM dd hh:mm:ss UTC yyyy : Received response. Status: 200, Integration latency: <latency> ms",
@@ -70,7 +70,7 @@
7070
"line05": "DDD MMM dd hh:mm:ss UTC yyyy : Method request headers: {content-type=application/json}",
7171
"line06": "DDD MMM dd hh:mm:ss UTC yyyy : Method request body before transformations: {\"test\": \"val123\"}",
7272
"line07": "DDD MMM dd hh:mm:ss UTC yyyy : Endpoint request URI: https://<endpoint_url>/2015-03-31/functions/arn:<partition>:lambda:<region>:111111111111:function:<function-name>/invocations",
73-
"line08": "DDD MMM dd hh:mm:ss UTC yyyy : Endpoint request headers: {x-amzn-lambda-integration-tag=<request-id-2>, Authorization=*******************************************************************************************************************************************************************************************************************************************************************************************************28eddc, X-Amz-Date=20250410T194004Z, x-amzn-apigateway-api-id=9tmlb8b101, Accept=application/json, User-Agent=AmazonAPIGateway_9tmlb8b101, X-Amz-Security-Token=IQoJb3JpZ2luX2VjEDQaCWV1LXdlc3QtMyJGMEQCIGUEndRBbvLl3Ueps7zoq7WeMd7Pi7papod7KAbC58tlAiAwacGZkYpzdiAx2FxQlGTyM3+6X68ew/HHVyvITaYyqyruAgit//////////8BEAAaDDY3MTEwNzY3ODQxMiIM6rAlcNDNqulZTyYaKsIC5Y3tA6xr/2uiYNj/DDQdZ3VrN12G1YU1jQWaOlbcrAFV5KrX42A+1kxHcrerVSvmm0SY5ZwCyb/QeExP1QV4d33sWO3R+IHtehpiqGyULAH4fWen48DxUkggjBIW+ehRY8E5aeyzSjShaZwDAikRF/gzhYoEfq+Oowpmp2Xq3vwTLCiLtMWqEqXsZAgDUslUce8c3LzpRhBFbU0LfEBeFRTiIH9l1Ul15HpnR/p1pSfo/IrejU2Bme0yTwgzUN8YxhsUX3vXCCX/ [TRUNCATED]",
73+
"line08": "DDD MMM dd hh:mm:ss UTC yyyy : Endpoint request headers: {x-amzn-lambda-integration-tag=<request-id-2>, Authorization=<authorization-header>, X-Amz-Date=<date>, x-amzn-apigateway-api-id=<rest-api-id>, Accept=application/json, User-Agent=AmazonAPIGateway_<rest-api-id>, X-Amz-Security-Token=<token> [TRUNCATED]",
7474
"line09": "DDD MMM dd hh:mm:ss UTC yyyy : Endpoint request body after transformations: {\"test\": \"val123\"}",
7575
"line10": "DDD MMM dd hh:mm:ss UTC yyyy : Sending request to https://lambda.<region>.amazonaws.com/2015-03-31/functions/arn:<partition>:lambda:<region>:111111111111:function:<function-name>/invocations",
7676
"line11": "DDD MMM dd hh:mm:ss UTC yyyy : Received response. Status: 200, Integration latency: <latency> ms",

tests/aws/services/apigateway/test_apigateway_basic.validation.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"last_validated_date": "2024-07-12T20:04:15+00:00"
1616
},
1717
"tests/aws/services/apigateway/test_apigateway_basic.py::TestAPIGateway::test_apigw_test_invoke_method_api": {
18-
"last_validated_date": "2025-04-10T19:40:04+00:00"
18+
"last_validated_date": "2025-04-11T18:03:13+00:00"
1919
},
2020
"tests/aws/services/apigateway/test_apigateway_basic.py::TestAPIGateway::test_update_rest_api_deployment": {
2121
"last_validated_date": "2024-04-12T21:24:49+00:00"

0 commit comments

Comments
 (0)