moto/tests/test_ses/test_server.py

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

26 lines
745 B
Python
Raw Normal View History

import re
from datetime import datetime
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")
assert b"ListIdentitiesResponse" in res.data
def test_ses_get_send_statistics():
backend = server.create_backend_app("ses")
test_client = backend.test_client()
res = test_client.get("/?Action=GetSendStatistics")
assert b"GetSendStatisticsResponse" in res.data
# 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")