<s> from __future__ import unicode_literals <EOL> import email <EOL> import boto <EOL> from boto . exception import BotoServerError <EOL> import sure <EOL> from moto import mock_ses <EOL> @ mock_ses <EOL> def test_verify_email_identity ( ) : <EOL> conn = boto . connect_ses ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> conn . verify_email_identity ( "<STR_LIT>" ) <EOL> identities = conn . list_identities ( ) <EOL> address = identities [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ <NUM_LIT:0> ] <EOL> address . should . equal ( '<STR_LIT>' ) <EOL> @ mock_ses <EOL> def test_domain_verify ( ) : <EOL> conn = boto . connect_ses ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> conn . verify_domain_dkim ( "<STR_LIT>" ) <EOL> conn . verify_domain_identity ( "<STR_LIT>" ) <EOL> identities = conn . list_identities ( ) <EOL> domains = list ( identities [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ '<STR_LIT>' ] ) <EOL> domains . should . equal ( [ '<STR_LIT>' , '<STR_LIT>' ] ) <EOL> @ mock_ses <EOL> def test_delete_identity ( ) : <EOL> conn = boto . connect_ses ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> conn . verify_email_identity ( "<STR_LIT>" ) <EOL> conn . list_identities ( ) [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ '<STR_LIT>' ] . should . have . length_of ( <NUM_LIT:1> ) <EOL> conn . delete_identity ( "<STR_LIT>" ) <EOL> conn . list_identities ( ) [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ '<STR_LIT>' ] . should . have . length_of ( <NUM_LIT:0> ) <EOL> @ mock_ses <EOL> def test_send_email ( ) : <EOL> conn = boto . connect_ses ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> conn . send_email . when . called_with ( <EOL> "<STR_LIT>" , "<STR_LIT>" , <EOL> "<STR_LIT>" , "<STR_LIT>" ) . should . throw ( BotoServerError ) <EOL> conn . verify_email_identity ( "<STR_LIT>" ) <EOL> conn . send_email ( "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ) <EOL> send_quota = conn . get_send_quota ( ) <EOL> sent_count = int ( send_quota [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ '<STR_LIT>' ] ) <EOL> sent_count . should . equal ( <NUM_LIT:1> ) <EOL> @ mock_ses <EOL> def test_send_html_email ( ) : <EOL> conn = boto . connect_ses ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> conn . send_email . when . called_with ( <EOL> "<STR_LIT>" , "<STR_LIT>" , <EOL> "<STR_LIT>" , "<STR_LIT>" , format = "<STR_LIT:html>" ) . should . throw ( BotoServerError ) <EOL> conn . verify_email_identity ( "<STR_LIT>" ) <EOL> conn . send_email ( "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , format = "<STR_LIT:html>" ) <EOL> send_quota = conn . get_send_quota ( ) <EOL> sent_count = int ( send_quota [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ '<STR_LIT>' ] ) <EOL> sent_count . should . equal ( <NUM_LIT:1> ) <EOL> @ mock_ses <EOL> def test_send_raw_email ( ) : <EOL> conn = boto . connect_ses ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> message = email . mime . multipart . MIMEMultipart ( ) <EOL> message [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> message [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> message [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> part = email . mime . text . MIMEText ( '<STR_LIT>' ) <EOL> message . attach ( part ) <EOL> part = email . mime . text . MIMEText ( '<STR_LIT>' ) <EOL> part . add_header ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> message . attach ( part ) <EOL> conn . send_raw_email . when . called_with ( <EOL> source = message [ '<STR_LIT>' ] , <EOL> raw_message = message . as_string ( ) , <EOL> ) . should . throw ( BotoServerError ) <EOL> conn . verify_email_identity ( "<STR_LIT>" ) <EOL> conn . send_raw_email ( <EOL> source = message [ '<STR_LIT>' ] , <EOL> raw_message = message . as_string ( ) , <EOL> ) <EOL> send_quota = conn . get_send_quota ( ) <EOL> sent_count = int ( send_quota [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ '<STR_LIT>' ] ) <EOL> sent_count . should . equal ( <NUM_LIT:1> ) </s>
