| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved | 2 # Copyright (c) 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved |
| 3 # | 3 # |
| 4 # Permission is hereby granted, free of charge, to any person obtaining a | 4 # Permission is hereby granted, free of charge, to any person obtaining a |
| 5 # copy of this software and associated documentation files (the | 5 # copy of this software and associated documentation files (the |
| 6 # "Software"), to deal in the Software without restriction, including | 6 # "Software"), to deal in the Software without restriction, including |
| 7 # without limitation the rights to use, copy, modify, merge, publish, dis- | 7 # without limitation the rights to use, copy, modify, merge, publish, dis- |
| 8 # tribute, sublicense, and/or sell copies of the Software, and to permit | 8 # tribute, sublicense, and/or sell copies of the Software, and to permit |
| 9 # persons to whom the Software is furnished to do so, subject to the fol- | 9 # persons to whom the Software is furnished to do so, subject to the fol- |
| 10 # lowing conditions: | 10 # lowing conditions: |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 self.assertEqual(ListElement, type(tokens)) | 71 self.assertEqual(ListElement, type(tokens)) |
| 72 self.assertEqual(3, len(tokens)) | 72 self.assertEqual(3, len(tokens)) |
| 73 self.assertEqual('vvjuipp74whm76gqoni7qmwwn4w4qusjiainivf6f', | 73 self.assertEqual('vvjuipp74whm76gqoni7qmwwn4w4qusjiainivf6f', |
| 74 tokens[0]) | 74 tokens[0]) |
| 75 self.assertEqual('3frqe7jn4obpuxjpwpolz6ipb3k5nvt2nhjpik2oy', | 75 self.assertEqual('3frqe7jn4obpuxjpwpolz6ipb3k5nvt2nhjpik2oy', |
| 76 tokens[1]) | 76 tokens[1]) |
| 77 self.assertEqual('wrqplteh7oodxnad7hsl4mixg2uavzneazxv5sxi2', | 77 self.assertEqual('wrqplteh7oodxnad7hsl4mixg2uavzneazxv5sxi2', |
| 78 tokens[2]) | 78 tokens[2]) |
| 79 | 79 |
| 80 | 80 |
| 81 class TestSESSetIdentityNotificationTopic(AWSMockServiceTestCase): |
| 82 connection_class = SESConnection |
| 83 |
| 84 def setUp(self): |
| 85 super(TestSESSetIdentityNotificationTopic, self).setUp() |
| 86 |
| 87 def default_body(self): |
| 88 return """<SetIdentityNotificationTopicResponse \ |
| 89 xmlns="http://ses.amazonaws.com/doc/2010-12-01/"> |
| 90 <SetIdentityNotificationTopicResult/> |
| 91 <ResponseMetadata> |
| 92 <RequestId>299f4af4-b72a-11e1-901f-1fbd90e8104f</RequestId> |
| 93 </ResponseMetadata> |
| 94 </SetIdentityNotificationTopicResponse>""" |
| 95 |
| 96 def test_ses_set_identity_notification_topic_bounce(self): |
| 97 self.set_http_response(status_code=200) |
| 98 |
| 99 response = self.service_connection\ |
| 100 .set_identity_notification_topic( |
| 101 identity='user@example.com', |
| 102 notification_type='Bounce', |
| 103 sns_topic='arn:aws:sns:us-east-1:123456789012:example') |
| 104 |
| 105 response = response['SetIdentityNotificationTopicResponse'] |
| 106 result = response['SetIdentityNotificationTopicResult'] |
| 107 |
| 108 self.assertEqual(2, len(response)) |
| 109 self.assertEqual(0, len(result)) |
| 110 |
| 111 def test_ses_set_identity_notification_topic_complaint(self): |
| 112 self.set_http_response(status_code=200) |
| 113 |
| 114 response = self.service_connection\ |
| 115 .set_identity_notification_topic( |
| 116 identity='user@example.com', |
| 117 notification_type='Complaint', |
| 118 sns_topic='arn:aws:sns:us-east-1:123456789012:example') |
| 119 |
| 120 response = response['SetIdentityNotificationTopicResponse'] |
| 121 result = response['SetIdentityNotificationTopicResult'] |
| 122 |
| 123 self.assertEqual(2, len(response)) |
| 124 self.assertEqual(0, len(result)) |
| 125 |
| 126 class TestSESSetIdentityFeedbackForwardingEnabled(AWSMockServiceTestCase): |
| 127 connection_class = SESConnection |
| 128 |
| 129 def setUp(self): |
| 130 super(TestSESSetIdentityFeedbackForwardingEnabled, self).setUp() |
| 131 |
| 132 def default_body(self): |
| 133 return """<SetIdentityFeedbackForwardingEnabledResponse \ |
| 134 xmlns="http://ses.amazonaws.com/doc/2010-12-01/"> |
| 135 <SetIdentityFeedbackForwardingEnabledResult/> |
| 136 <ResponseMetadata> |
| 137 <RequestId>299f4af4-b72a-11e1-901f-1fbd90e8104f</RequestId> |
| 138 </ResponseMetadata> |
| 139 </SetIdentityFeedbackForwardingEnabledResponse>""" |
| 140 |
| 141 def test_ses_set_identity_feedback_forwarding_enabled_true(self): |
| 142 self.set_http_response(status_code=200) |
| 143 |
| 144 response = self.service_connection\ |
| 145 .set_identity_feedback_forwarding_enabled( |
| 146 identity='user@example.com', |
| 147 forwarding_enabled=True) |
| 148 |
| 149 response = response['SetIdentityFeedbackForwardingEnabledResponse'] |
| 150 result = response['SetIdentityFeedbackForwardingEnabledResult'] |
| 151 |
| 152 self.assertEqual(2, len(response)) |
| 153 self.assertEqual(0, len(result)) |
| 154 |
| 155 def test_ses_set_identity_notification_topic_enabled_false(self): |
| 156 self.set_http_response(status_code=200) |
| 157 |
| 158 response = self.service_connection\ |
| 159 .set_identity_feedback_forwarding_enabled( |
| 160 identity='user@example.com', |
| 161 forwarding_enabled=False) |
| 162 |
| 163 response = response['SetIdentityFeedbackForwardingEnabledResponse'] |
| 164 result = response['SetIdentityFeedbackForwardingEnabledResult'] |
| 165 |
| 166 self.assertEqual(2, len(response)) |
| 167 self.assertEqual(0, len(result)) |
| 168 |
| 169 |
| 81 if __name__ == '__main__': | 170 if __name__ == '__main__': |
| 82 unittest.main() | 171 unittest.main() |
| OLD | NEW |