Skip to content

Commit 73e4f6c

Browse files
authored
Upgrade moto (#13262)
1 parent 8f5b405 commit 73e4f6c

File tree

9 files changed

+64
-23
lines changed

9 files changed

+64
-23
lines changed

localstack-core/localstack/services/ses/provider.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,7 @@ def set_identity_headers_in_notifications_enabled(
558558
)
559559

560560
backend = get_ses_backend(context)
561-
if identity not in backend.addresses:
561+
if identity not in backend.email_identities:
562562
raise MessageRejected(f"Identity {identity} is not verified or does not exist.")
563563

564564
# Store the setting in the backend

pyproject.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,7 @@ runtime = [
9393
"json5>=0.9.11",
9494
"jsonpath-ng>=1.6.1",
9595
"jsonpath-rw>=1.4.0",
96-
# TODO revert pin once moto upgrade is completed
97-
# "moto-ext[all]>=5.1.12.post22",
98-
"moto-ext[all]==5.1.14.post7",
96+
"moto-ext[all]>=5.1.12.post22",
9997
"opensearch-py>=2.4.1",
10098
"pymongo>=4.2.0",
10199
"pyopenssl>=23.0.0",

requirements-dev.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ mdurl==0.1.2
250250
# via markdown-it-py
251251
more-itertools==10.8.0
252252
# via openapi-core
253-
moto-ext==5.1.14.post7
253+
moto-ext==5.1.14.post34
254254
# via localstack-core
255255
mpmath==1.3.0
256256
# via sympy

requirements-runtime.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ mdurl==0.1.2
188188
# via markdown-it-py
189189
more-itertools==10.8.0
190190
# via openapi-core
191-
moto-ext==5.1.14.post7
191+
moto-ext==5.1.14.post34
192192
# via localstack-core (pyproject.toml)
193193
mpmath==1.3.0
194194
# via sympy

requirements-test.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ mdurl==0.1.2
234234
# via markdown-it-py
235235
more-itertools==10.8.0
236236
# via openapi-core
237-
moto-ext==5.1.14.post7
237+
moto-ext==5.1.14.post34
238238
# via localstack-core
239239
mpmath==1.3.0
240240
# via sympy

requirements-typehint.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ mdurl==0.1.2
254254
# via markdown-it-py
255255
more-itertools==10.8.0
256256
# via openapi-core
257-
moto-ext==5.1.14.post7
257+
moto-ext==5.1.14.post34
258258
# via localstack-core
259259
mpmath==1.3.0
260260
# via sympy

tests/aws/services/acm/test_acm.py

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import pytest
2+
from botocore.exceptions import ClientError
23
from localstack_snapshot.snapshots.transformer import SortingTransformer
34
from moto import settings as moto_settings
45

56
from localstack.testing.aws.util import is_aws_cloud
67
from localstack.testing.pytest import markers
78
from localstack.utils.crypto import generate_ssl_cert
89
from localstack.utils.strings import short_uid
9-
from localstack.utils.sync import retry
10+
from localstack.utils.sync import retry, wait_until
1011

1112

1213
class TestACM:
@@ -27,7 +28,7 @@ class TestACM:
2728
]
2829
)
2930
def test_import_certificate(self, tmp_path, aws_client, cleanups, snapshot):
30-
with pytest.raises(Exception) as exc_info:
31+
with pytest.raises(ClientError) as exc_info:
3132
aws_client.acm.import_certificate(Certificate=b"CERT123", PrivateKey=b"KEY123")
3233
assert exc_info.value.response["Error"]["Code"] == "ValidationException"
3334

@@ -72,6 +73,15 @@ def test_domain_validation(self, acm_request_certificate, aws_client, snapshot):
7273
snapshot.add_transformer(snapshot.transform.key_value("SignatureAlgorithm"))
7374

7475
certificate_arn = acm_request_certificate()["CertificateArn"]
76+
77+
# we are manually waiting for some fields to be returned, as they are missing soon after creating the cert
78+
def _cert_has_required_fields() -> bool:
79+
_resp = aws_client.acm.describe_certificate(CertificateArn=certificate_arn)
80+
return "DomainName" in _resp["Certificate"]
81+
82+
if is_aws_cloud():
83+
wait_until(_cert_has_required_fields, wait=2, max_retries=20)
84+
7585
result = aws_client.acm.describe_certificate(CertificateArn=certificate_arn)
7686
snapshot.match("describe-certificate", result)
7787

@@ -84,8 +94,17 @@ def test_boto_wait_for_certificate_validation(
8494
waiter = aws_client.acm.get_waiter("certificate_validated")
8595
waiter.wait(CertificateArn=certificate_arn, WaiterConfig={"Delay": 0.5, "MaxAttempts": 3})
8696

87-
@markers.aws.validated
88-
@markers.snapshot.skip_snapshot_verify(paths=["$..Certificate.SignatureAlgorithm"])
97+
@markers.aws.manual_setup_required
98+
# this test requires manual input to our DNS provider
99+
@markers.snapshot.skip_snapshot_verify(
100+
paths=[
101+
"$..Certificate.SignatureAlgorithm",
102+
# those should also be returned by AWS, but regenerating the snapshots needs manual input
103+
# skipped for now, validated by other tests
104+
"$..Certificate.Options.Export",
105+
"$..Exported",
106+
]
107+
)
89108
def test_certificate_for_subdomain_wildcard(
90109
self, acm_request_certificate, aws_client, snapshot, monkeypatch
91110
):
@@ -123,7 +142,7 @@ def _get_cert_with_records():
123142
if is_aws_cloud():
124143
# Wait until DNS entry has been added (needs to be done manually!)
125144
# Note: When running parity tests against AWS, we need to add the CNAME record to our DNS
126-
# server (currently with gandi.net), to enable validation of the certificate.
145+
# server (currently with Route53), to enable validation of the certificate.
127146
prompt = (
128147
f"Please add the following CNAME entry to the LocalStack DNS server, then hit [ENTER] once "
129148
f"the certificate has been validated in AWS: {dns_options['Name']} = {dns_options['Value']}"
@@ -161,6 +180,7 @@ def _get_cert_issued():
161180
"$..ResourceRecord",
162181
"$..SignatureAlgorithm",
163182
"$..Serial",
183+
"$..ExportOption",
164184
]
165185
)
166186
def test_create_certificate_for_multiple_alternative_domains(

tests/aws/services/acm/test_acm.snapshot.json

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -139,19 +139,21 @@
139139
}
140140
},
141141
"tests/aws/services/acm/test_acm.py::TestACM::test_create_certificate_for_multiple_alternative_domains": {
142-
"recorded-date": "09-01-2024, 14:58:14",
142+
"recorded-date": "14-10-2025, 09:18:38",
143143
"recorded-content": {
144144
"list-cert-summary-list": {
145145
"CertificateArn": "arn:<partition>:acm:<region>:111111111111:certificate/<cert-id>",
146146
"CreatedAt": "datetime",
147147
"DomainName": "test.example.com",
148+
"ExportOption": "DISABLED",
149+
"Exported": false,
148150
"ExtendedKeyUsages": [],
149151
"HasAdditionalSubjectAlternativeNames": false,
150152
"InUse": false,
151153
"KeyAlgorithm": "RSA-2048",
152154
"KeyUsages": [],
153155
"RenewalEligibility": "INELIGIBLE",
154-
"Status": "FAILED",
156+
"Status": "PENDING_VALIDATION",
155157
"SubjectAlternativeNameSummaries": [
156158
"*.test.example.com",
157159
"another.domain.com",
@@ -201,7 +203,8 @@
201203
"KeyAlgorithm": "RSA-2048",
202204
"KeyUsages": [],
203205
"Options": {
204-
"CertificateTransparencyLoggingPreference": "ENABLED"
206+
"CertificateTransparencyLoggingPreference": "ENABLED",
207+
"Export": "DISABLED"
205208
},
206209
"RenewalEligibility": "INELIGIBLE",
207210
"SignatureAlgorithm": "SHA256WITHRSA",
@@ -218,7 +221,7 @@
218221
}
219222
},
220223
"tests/aws/services/acm/test_acm.py::TestACM::test_import_certificate": {
221-
"recorded-date": "22-02-2024, 17:41:15",
224+
"recorded-date": "14-10-2025, 09:17:56",
222225
"recorded-content": {
223226
"import-certificate-response": {
224227
"CertificateArn": "arn:<partition>:acm:<region>:111111111111:certificate/<cert-id>",
@@ -270,7 +273,8 @@
270273
"NotAfter": "datetime",
271274
"NotBefore": "datetime",
272275
"Options": {
273-
"CertificateTransparencyLoggingPreference": "DISABLED"
276+
"CertificateTransparencyLoggingPreference": "DISABLED",
277+
"Export": "DISABLED"
274278
},
275279
"RenewalEligibility": "INELIGIBLE",
276280
"Serial": "03:e9",
@@ -293,7 +297,7 @@
293297
}
294298
},
295299
"tests/aws/services/acm/test_acm.py::TestACM::test_domain_validation": {
296-
"recorded-date": "12-04-2024, 15:36:37",
300+
"recorded-date": "14-10-2025, 09:31:48",
297301
"recorded-content": {
298302
"describe-certificate": {
299303
"Certificate": {
@@ -315,7 +319,8 @@
315319
"KeyAlgorithm": "RSA-2048",
316320
"KeyUsages": [],
317321
"Options": {
318-
"CertificateTransparencyLoggingPreference": "ENABLED"
322+
"CertificateTransparencyLoggingPreference": "ENABLED",
323+
"Export": "DISABLED"
319324
},
320325
"RenewalEligibility": "INELIGIBLE",
321326
"SignatureAlgorithm": "<signature-algorithm:1>",

tests/aws/services/acm/test_acm.validation.json

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,30 @@
33
"last_validated_date": "2023-04-18T17:01:27+00:00"
44
},
55
"tests/aws/services/acm/test_acm.py::TestACM::test_create_certificate_for_multiple_alternative_domains": {
6-
"last_validated_date": "2024-01-09T14:58:14+00:00"
6+
"last_validated_date": "2025-10-14T09:18:39+00:00",
7+
"durations_in_seconds": {
8+
"setup": 0.45,
9+
"call": 5.97,
10+
"teardown": 0.19,
11+
"total": 6.61
12+
}
713
},
814
"tests/aws/services/acm/test_acm.py::TestACM::test_domain_validation": {
9-
"last_validated_date": "2024-04-12T15:36:37+00:00"
15+
"last_validated_date": "2025-10-14T09:31:48+00:00",
16+
"durations_in_seconds": {
17+
"setup": 0.46,
18+
"call": 2.94,
19+
"teardown": 0.21,
20+
"total": 3.61
21+
}
1022
},
1123
"tests/aws/services/acm/test_acm.py::TestACM::test_import_certificate": {
12-
"last_validated_date": "2024-02-22T17:41:15+00:00"
24+
"last_validated_date": "2025-10-14T09:17:56+00:00",
25+
"durations_in_seconds": {
26+
"setup": 0.48,
27+
"call": 1.25,
28+
"teardown": 0.25,
29+
"total": 1.98
30+
}
1331
}
1432
}

0 commit comments

Comments
 (0)