diff options
author | Felix Yan <felixonmars@gmail.com> | 2014-08-20 10:54:18 +0800 |
---|---|---|
committer | Felix Yan <felixonmars@gmail.com> | 2014-08-20 10:54:18 +0800 |
commit | cf91629fcd33a4642a75c8fabb24e88affc2e83d (patch) | |
tree | 7f4d673a087d88f32e765d5c2d14a1b66e0a4f8e | |
parent | c8c625ad09246e1a835f4a05174e8ed1495cbb00 (diff) | |
download | boto-cf91629fcd33a4642a75c8fabb24e88affc2e83d.tar.gz |
ses module: tidy up to meet PEP8 better
-rw-r--r-- | boto/ses/connection.py | 41 | ||||
-rw-r--r-- | boto/ses/exceptions.py | 5 | ||||
-rw-r--r-- | tests/integration/ses/test_connection.py | 2 | ||||
-rw-r--r-- | tests/unit/ses/test_identity.py | 1 |
4 files changed, 26 insertions, 23 deletions
diff --git a/boto/ses/connection.py b/boto/ses/connection.py index ed69ad29..d9774125 100644 --- a/boto/ses/connection.py +++ b/boto/ses/connection.py @@ -48,13 +48,13 @@ class SESConnection(AWSAuthConnection): self.DefaultRegionEndpoint) self.region = region super(SESConnection, self).__init__(self.region.endpoint, - aws_access_key_id, aws_secret_access_key, - is_secure, port, proxy, proxy_port, - proxy_user, proxy_pass, debug, - https_connection_factory, path, - security_token=security_token, - validate_certs=validate_certs, - profile_name=profile_name) + aws_access_key_id, aws_secret_access_key, + is_secure, port, proxy, proxy_port, + proxy_user, proxy_pass, debug, + https_connection_factory, path, + security_token=security_token, + validate_certs=validate_certs, + profile_name=profile_name) def _required_auth_capability(self): return ['ses'] @@ -260,18 +260,18 @@ class SESConnection(AWSAuthConnection): raise ValueError("No text or html body found for mail") self._build_list_params(params, to_addresses, - 'Destination.ToAddresses.member') + 'Destination.ToAddresses.member') if cc_addresses: self._build_list_params(params, cc_addresses, - 'Destination.CcAddresses.member') + 'Destination.CcAddresses.member') if bcc_addresses: self._build_list_params(params, bcc_addresses, - 'Destination.BccAddresses.member') + 'Destination.BccAddresses.member') if reply_addresses: self._build_list_params(params, reply_addresses, - 'ReplyToAddresses.member') + 'ReplyToAddresses.member') return self._make_request('SendEmail', params) @@ -318,7 +318,7 @@ class SESConnection(AWSAuthConnection): if destinations: self._build_list_params(params, destinations, - 'Destinations.member') + 'Destinations.member') return self._make_request('SendRawEmail', params) @@ -475,7 +475,7 @@ class SESConnection(AWSAuthConnection): """ params = {} self._build_list_params(params, identities, - 'Identities.member') + 'Identities.member') return self._make_request('GetIdentityVerificationAttributes', params) def verify_domain_identity(self, domain): @@ -531,17 +531,17 @@ class SESConnection(AWSAuthConnection): :param identity: An email address or domain name. :type notification_type: string - :param notification_type: The type of feedback notifications that will + :param notification_type: The type of feedback notifications that will be published to the specified topic. Valid Values: Bounce | Complaint | Delivery :type sns_topic: string or None - :param sns_topic: The Amazon Resource Name (ARN) of the Amazon Simple - Notification Service (Amazon SNS) topic. + :param sns_topic: The Amazon Resource Name (ARN) of the Amazon Simple + Notification Service (Amazon SNS) topic. """ params = { - 'Identity': identity, - 'NotificationType': notification_type + 'Identity': identity, + 'NotificationType': notification_type } if sns_topic: params['SnsTopic'] = sns_topic @@ -560,7 +560,6 @@ class SESConnection(AWSAuthConnection): :param forwarding_enabled: Specifies whether or not to enable feedback forwarding. """ return self._make_request('SetIdentityFeedbackForwardingEnabled', { - 'Identity': identity, - 'ForwardingEnabled': 'true' if forwarding_enabled else 'false' + 'Identity': identity, + 'ForwardingEnabled': 'true' if forwarding_enabled else 'false' }) - diff --git a/boto/ses/exceptions.py b/boto/ses/exceptions.py index c3341ece..d5649f61 100644 --- a/boto/ses/exceptions.py +++ b/boto/ses/exceptions.py @@ -3,6 +3,7 @@ Various exceptions that are specific to the SES module. """ from boto.exception import BotoServerError + class SESError(BotoServerError): """ Sub-class all SES-related errors from here. Don't raise this error @@ -13,24 +14,26 @@ class SESError(BotoServerError): pass - class SESAddressNotVerifiedError(SESError): """ Raised when a "Reply-To" address has not been validated in SES yet. """ pass + class SESIdentityNotVerifiedError(SESError): """ Raised when an identity (domain or address) has not been verified in SES yet. """ pass + class SESDomainNotConfirmedError(SESError): """ """ pass + class SESAddressBlacklistedError(SESError): """ After you attempt to send mail to an address, and delivery repeatedly diff --git a/tests/integration/ses/test_connection.py b/tests/integration/ses/test_connection.py index 83b99944..4e849e9f 100644 --- a/tests/integration/ses/test_connection.py +++ b/tests/integration/ses/test_connection.py @@ -18,7 +18,7 @@ class SESConnectionTest(unittest.TestCase): self.assertTrue('GetIdentityDkimAttributesResult' in response['GetIdentityDkimAttributesResponse']) self.assertTrue( - 'DkimAttributes' in response['GetIdentityDkimAttributesResponse']\ + 'DkimAttributes' in response['GetIdentityDkimAttributesResponse'] ['GetIdentityDkimAttributesResult']) def test_set_identity_dkim_enabled(self): diff --git a/tests/unit/ses/test_identity.py b/tests/unit/ses/test_identity.py index 26f5388d..014d68ab 100644 --- a/tests/unit/ses/test_identity.py +++ b/tests/unit/ses/test_identity.py @@ -123,6 +123,7 @@ class TestSESSetIdentityNotificationTopic(AWSMockServiceTestCase): self.assertEqual(2, len(response)) self.assertEqual(0, len(result)) + class TestSESSetIdentityFeedbackForwardingEnabled(AWSMockServiceTestCase): connection_class = SESConnection |