Merge pull request #2966 from usmangani1/SES_mod

SES get send statistics response modification
This commit is contained in:
Bert Blommers 2020-05-07 11:30:32 +01:00 committed by GitHub
commit ed109dae91
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 28 additions and 18 deletions

View File

@ -292,20 +292,22 @@ SET_IDENTITY_NOTIFICATION_TOPIC_RESPONSE = """<SetIdentityNotificationTopicRespo
</SetIdentityNotificationTopicResponse>""" </SetIdentityNotificationTopicResponse>"""
GET_SEND_STATISTICS = """<GetSendStatisticsResponse xmlns="http://ses.amazonaws.com/doc/2010-12-01/"> GET_SEND_STATISTICS = """<GetSendStatisticsResponse xmlns="http://ses.amazonaws.com/doc/2010-12-01/">
<SendDataPoints> <GetSendStatisticsResult>
{% for statistics in all_statistics %} <SendDataPoints>
<item> {% for statistics in all_statistics %}
<DeliveryAttempts>{{ statistics["DeliveryAttempts"] }}</DeliveryAttempts> <item>
<Rejects>{{ statistics["Rejects"] }}</Rejects> <DeliveryAttempts>{{ statistics["DeliveryAttempts"] }}</DeliveryAttempts>
<Bounces>{{ statistics["Bounces"] }}</Bounces> <Rejects>{{ statistics["Rejects"] }}</Rejects>
<Complaints>{{ statistics["Complaints"] }}</Complaints> <Bounces>{{ statistics["Bounces"] }}</Bounces>
<Timestamp>{{ statistics["Timestamp"] }}</Timestamp> <Complaints>{{ statistics["Complaints"] }}</Complaints>
</item> <Timestamp>{{ statistics["Timestamp"] }}</Timestamp>
{% endfor %} </item>
</SendDataPoints> {% endfor %}
<ResponseMetadata> </SendDataPoints>
<RequestId>e0abcdfa-c866-11e0-b6d0-273d09173z49</RequestId> <ResponseMetadata>
</ResponseMetadata> <RequestId>e0abcdfa-c866-11e0-b6d0-273d09173z49</RequestId>
</ResponseMetadata>
</GetSendStatisticsResult>
</GetSendStatisticsResponse>""" </GetSendStatisticsResponse>"""
CREATE_CONFIGURATION_SET = """<CreateConfigurationSetResponse xmlns="http://ses.amazonaws.com/doc/2010-12-01/"> CREATE_CONFIGURATION_SET = """<CreateConfigurationSetResponse xmlns="http://ses.amazonaws.com/doc/2010-12-01/">

View File

@ -145,10 +145,14 @@ def test_get_send_statistics():
result = conn.get_send_statistics() result = conn.get_send_statistics()
reject_count = int( reject_count = int(
result["GetSendStatisticsResponse"]["SendDataPoints"][0]["Rejects"] result["GetSendStatisticsResponse"]["GetSendStatisticsResult"][
"SendDataPoints"
][0]["Rejects"]
) )
delivery_count = int( delivery_count = int(
result["GetSendStatisticsResponse"]["SendDataPoints"][0]["DeliveryAttempts"] result["GetSendStatisticsResponse"]["GetSendStatisticsResult"][
"SendDataPoints"
][0]["DeliveryAttempts"]
) )
reject_count.should.equal(1) reject_count.should.equal(1)
delivery_count.should.equal(0) delivery_count.should.equal(0)
@ -162,10 +166,14 @@ def test_get_send_statistics():
result = conn.get_send_statistics() result = conn.get_send_statistics()
reject_count = int( reject_count = int(
result["GetSendStatisticsResponse"]["SendDataPoints"][0]["Rejects"] result["GetSendStatisticsResponse"]["GetSendStatisticsResult"][
"SendDataPoints"
][0]["Rejects"]
) )
delivery_count = int( delivery_count = int(
result["GetSendStatisticsResponse"]["SendDataPoints"][0]["DeliveryAttempts"] result["GetSendStatisticsResponse"]["GetSendStatisticsResult"][
"SendDataPoints"
][0]["DeliveryAttempts"]
) )
reject_count.should.equal(1) reject_count.should.equal(1)
delivery_count.should.equal(1) delivery_count.should.equal(1)