Permalink
Browse files

Merge pull request #2538 from felixonmars/ses-tidy

PEP8 style fixes for SES. Fixes #2538.
  • Loading branch information...
danielgtaylor committed Aug 22, 2014
2 parents 9efebc2 + cf91629 commit c620c43872cd52824ad4a4ba38fc998c8dfa2762
Showing with 26 additions and 23 deletions.
  1. +20 −21 boto/ses/connection.py
  2. +4 −1 boto/ses/exceptions.py
  3. +1 −1 tests/integration/ses/test_connection.py
  4. +1 −0 tests/unit/ses/test_identity.py
View
@@ -48,13 +48,13 @@ def __init__(self, aws_access_key_id=None, aws_secret_access_key=None,
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 @@ def send_email(self, source, subject, body, to_addresses,
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 @@ def send_raw_email(self, raw_message, source=None, destinations=None):
if destinations:
self._build_list_params(params, destinations,
'Destinations.member')
'Destinations.member')
return self._make_request('SendRawEmail', params)
@@ -475,7 +475,7 @@ def get_identity_verification_attributes(self, identities):
"""
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 @@ def set_identity_notification_topic(self, identity, notification_type, sns_topic
: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 @@ def set_identity_feedback_forwarding_enabled(self, identity, forwarding_enabled=
: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'
})
View
@@ -3,6 +3,7 @@
"""
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
@@ -18,7 +18,7 @@ def test_get_dkim_attributes(self):
self.assertTrue('GetIdentityDkimAttributesResult' in
response['GetIdentityDkimAttributesResponse'])
self.assertTrue(
'DkimAttributes' in response['GetIdentityDkimAttributesResponse']\
'DkimAttributes' in response['GetIdentityDkimAttributesResponse']
['GetIdentityDkimAttributesResult'])
def test_set_identity_dkim_enabled(self):
@@ -123,6 +123,7 @@ def test_ses_set_identity_notification_topic_complaint(self):
self.assertEqual(2, len(response))
self.assertEqual(0, len(result))
class TestSESSetIdentityFeedbackForwardingEnabled(AWSMockServiceTestCase):
connection_class = SESConnection

0 comments on commit c620c43

Please sign in to comment.