Skip to content
This repository was archived by the owner on Mar 23, 2026. It is now read-only.

Commit 4feeb9a

Browse files
committed
SES: add snapshot test for describe_configuration_set with SNS destinations
Related to issue #12722 Requires getmoto/moto#9023
1 parent 15fc427 commit 4feeb9a

3 files changed

Lines changed: 73 additions & 0 deletions

File tree

tests/aws/services/ses/test_ses.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import pytest
77
import requests
88
from botocore.exceptions import ClientError
9+
from localstack_snapshot.snapshots.transformer import SortingTransformer
910

1011
import localstack.config as config
1112
from localstack.services.ses.provider import EMAILS, EMAILS_ENDPOINT
@@ -287,6 +288,39 @@ def _assert_sent_quota(expected_counter: int) -> dict:
287288
_ = retry(_assert_sent_quota, expected_counter=counter + 1, retries=retries, sleep=1)
288289
# snapshot.match('get-quota-3', _)
289290

291+
@markers.aws.validated
292+
def test_describe_config_set_event_destinations(
293+
self,
294+
aws_client,
295+
sns_topic,
296+
ses_configuration_set,
297+
ses_configuration_set_sns_event_destination,
298+
snapshot,
299+
):
300+
config_set_name = f"config-set-{short_uid()}"
301+
snapshot.add_transformer(snapshot.transform.regex(config_set_name, "<config-set-name>"))
302+
303+
topic_arn = sns_topic["Attributes"]["TopicArn"]
304+
snapshot.add_transformer(snapshot.transform.regex(topic_arn, "<arn>"))
305+
306+
ses_configuration_set(config_set_name)
307+
event_destination_name = f"config-set-event-destination-{short_uid()}"
308+
snapshot.add_transformer(
309+
snapshot.transform.regex(event_destination_name, "<event-destination-name>")
310+
)
311+
312+
snapshot.add_transformer(SortingTransformer("MatchingEventTypes"))
313+
314+
ses_configuration_set_sns_event_destination(
315+
config_set_name, event_destination_name, topic_arn
316+
)
317+
318+
response = aws_client.ses.describe_configuration_set(
319+
ConfigurationSetName=config_set_name,
320+
ConfigurationSetAttributeNames=["eventDestinations"],
321+
)
322+
snapshot.match("event_destinations", response)
323+
290324
@markers.aws.validated
291325
@markers.snapshot.skip_snapshot_verify(
292326
paths=[

tests/aws/services/ses/test_ses.snapshot.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1081,5 +1081,35 @@
10811081
}
10821082
}
10831083
}
1084+
},
1085+
"tests/aws/services/ses/test_ses.py::TestSES::test_describe_config_set_event_destinations": {
1086+
"recorded-date": "20-08-2025, 12:00:48",
1087+
"recorded-content": {
1088+
"event_destinations": {
1089+
"ConfigurationSet": {
1090+
"Name": "<config-set-name>"
1091+
},
1092+
"EventDestinations": [
1093+
{
1094+
"Enabled": true,
1095+
"MatchingEventTypes": [
1096+
"bounce",
1097+
"click",
1098+
"delivery",
1099+
"open",
1100+
"send"
1101+
],
1102+
"Name": "<event-destination-name>",
1103+
"SNSDestination": {
1104+
"TopicARN": "<arn>"
1105+
}
1106+
}
1107+
],
1108+
"ResponseMetadata": {
1109+
"HTTPHeaders": {},
1110+
"HTTPStatusCode": 200
1111+
}
1112+
}
1113+
}
10841114
}
10851115
}

tests/aws/services/ses/test_ses.validation.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,15 @@
2323
"tests/aws/services/ses/test_ses.py::TestSES::test_deleting_non_existent_configuration_set_event_destination": {
2424
"last_validated_date": "2023-08-25T22:04:53+00:00"
2525
},
26+
"tests/aws/services/ses/test_ses.py::TestSES::test_describe_config_set_event_destinations": {
27+
"last_validated_date": "2025-08-20T12:00:48+00:00",
28+
"durations_in_seconds": {
29+
"setup": 2.09,
30+
"call": 1.15,
31+
"teardown": 0.58,
32+
"total": 3.82
33+
}
34+
},
2635
"tests/aws/services/ses/test_ses.py::TestSES::test_invalid_tags_send_email[-]": {
2736
"last_validated_date": "2024-07-30T10:18:09+00:00"
2837
},

0 commit comments

Comments
 (0)