Feature/improve SES documentation (#5585)

This commit is contained in:
Ben Dalby 2022-10-20 22:21:04 +01:00 committed by GitHub
parent 2f8ecad9aa
commit 80ab997010
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 0 deletions

View File

@ -12,6 +12,8 @@
ses
===
.. autoclass:: moto.ses.models.SESBackend
|start-h3| Example usage |end-h3|
.. sourcecode:: python

View File

@ -119,6 +119,21 @@ def are_all_variables_present(template, template_data):
class SESBackend(BaseBackend):
"""
Responsible for mocking calls to SES.
Sent messages are persisted in the backend. If you need to verify that a message was sent successfully, you can use the internal API to check:
.. sourcecode:: python
from moto.core import DEFAULT_ACCOUNT_ID
from moto.ses import ses_backends
ses_backend = ses_backends[DEFAULT_ACCOUNT_ID]["global"]
messages = ses_backend.sent_messages # sent_messages is a List of Message objects
Note that, as this is an internal API, the exact format may differ per versions.
"""
def __init__(self, region_name, account_id):
super().__init__(region_name, account_id)
self.addresses = []