2022-02-08 17:24:41 +00:00
|
|
|
import re
|
2023-11-30 15:55:51 +00:00
|
|
|
from datetime import datetime
|
2022-02-08 17:24:41 +00:00
|
|
|
|
2013-03-05 13:14:43 +00:00
|
|
|
import moto.server as server
|
|
|
|
|
|
|
|
|
|
|
|
def test_ses_list_identities():
|
2013-12-29 01:15:37 +00:00
|
|
|
backend = server.create_backend_app("ses")
|
|
|
|
test_client = backend.test_client()
|
|
|
|
|
2013-03-05 13:14:43 +00:00
|
|
|
res = test_client.get("/?Action=ListIdentities")
|
2023-08-04 14:14:14 +00:00
|
|
|
assert b"ListIdentitiesResponse" in res.data
|
2022-02-08 17:24:41 +00:00
|
|
|
|
|
|
|
|
|
|
|
def test_ses_get_send_statistics():
|
|
|
|
backend = server.create_backend_app("ses")
|
|
|
|
test_client = backend.test_client()
|
|
|
|
|
|
|
|
res = test_client.get("/?Action=GetSendStatistics")
|
2023-08-04 14:14:14 +00:00
|
|
|
assert b"GetSendStatisticsResponse" in res.data
|
2022-02-08 17:24:41 +00:00
|
|
|
|
|
|
|
# Timestamps must be in ISO 8601 format
|
|
|
|
groups = re.search("<Timestamp>(.*)</Timestamp>", res.data.decode("utf-8"))
|
|
|
|
timestamp = groups.groups()[0]
|
|
|
|
datetime.strptime(timestamp, "%Y-%m-%dT%H:%M:%S.%f")
|