Your IP : 216.73.216.213


Current Path : /opt/alt/python38/lib64/python3.8/test/test_email/__pycache__/
Upload File :
Current File : //opt/alt/python38/lib64/python3.8/test/test_email/__pycache__/test_message.cpython-38.opt-2.pyc

U

i�f/��@s�ddlZddlZddlmZmZddlmZmZddlm	Z	m
Z
dd�ZGdd�de	�Ze
Gd	d
�d
��Z
Gdd�de
e	�ZGd
d�de
e	�Zedkr�e��dS)�N)�policy�message_from_string)�EmailMessage�MIMEPart)�
TestEmailBase�parameterizecCsttdd�|�d�S)NcSs|dk	S�N�)�xr	r	�A/opt/alt/python38/lib64/python3.8/test/test_email/test_message.py�<lambda>
�zfirst.<locals>.<lambda>)�next�filter)�iterabler	r	r�first	src@s"eZdZejZdd�Zdd�ZdS)�Testc	Cs4|�d�}d|d<|�t��d|d<W5QRXdS)N�zabc@xyz�Tozxyz@abc)�_str_msg�assertRaises�
ValueError��self�mr	r	r�+test_error_on_setitem_if_max_count_exceededs
z0Test.test_error_on_setitem_if_max_count_exceededcCsDtt�d�tjd�}|�|dd�|�|dd�|�|t�dS)Na>            Subject: Ayons asperges pour le =?utf-8?q?d=C3=A9jeuner?=
            From: =?utf-8?q?Pep=C3=A9?= Le Pew <pepe@example.com>
            To: "Penelope Pussycat" <"penelope@example.com">
            MIME-Version: 1.0
            Content-Type: text/plain; charset="utf-8"

            sample text
            �rZsubjectu Ayons asperges pour le déjeuner�fromuPepé Le Pew <pepe@example.com>)r�textwrap�dedentr�default�assertEqualZassertIsInstancerrr	r	r�/test_rfc2043_auto_decoded_and_emailmessage_useds
�	z4Test.test_rfc2043_auto_decoded_and_emailmessage_usedN)�__name__�
__module__�__qualname__rr rr"r	r	r	rr
src@s�eZdZejZdddde�d�fddde�d�fddde�d	�fddde�d
�fddde�d
�fddde�d�fddde�d�fddde�d�fddde�d�fddde�d�fddde�d�fddde�d�fddde�d�fddde�d�fd �Zd!d"�Zd#d$�Z	d%d&�Z
Gd'd(�d(�Zd)d*�Zd+d,�Z
d-d.�Zd/d0�Zd1Zd2d3�Zd4d5�Zd6d7�Zd8d9�Zd:d;�Zd<d=�ZGd>d?�d?�Zd@dA�ZGdBdC�dC�ZdDdE�ZdFdG�ZdHdI�ZdJdK�ZdLdM�ZdNS)O�TestEmailMessageBase)�NNrr	r	rr'r	zV                To: foo@example.com

                simple text body
                )NNNz�                To: foo@example.com
                MIME-Version: 1.0
                Content-Type: image/jpg

                bogus body.
                )N��)r)r(a�                To: foo@example.com
                MIME-Version: 1.0
                Content-Type: multipart/alternative; boundary="==="

                preamble

                --===
                Content-Type: text/plain

                simple body

                --===
                Content-Type: text/html

                <p>simple body</p>
                --===--
                a�                To: foo@example.com
                MIME-Version: 1.0
                Content-Type: multipart/mixed; boundary="==="

                preamble

                --===
                Content-Type: text/plain

                simple body

                --===
                Content-Type: text/html

                <p>simple body</p>

                --===--
                )NNr))r(a�                To: foo@example.com
                MIME-Version: 1.0
                Content-Type: multipart/mixed; boundary="==="

                --===
                Content-Type: text/plain

                simple body

                --===
                Content-Type: text/html
                Content-Disposition: attachment

                <p>simple body</p>

                --===--
                )Nr(N)r)a�                To: foo@example.com
                MIME-Version: 1.0
                Content-Type: multipart/mixed; boundary="==="

                --===
                Content-Type: text/plain
                Content-Disposition: AtTaChment

                simple body

                --===
                Content-Type: text/html

                <p>simple body</p>

                --===--
                a�                To: foo@example.com
                MIME-Version: 1.0
                Content-Type: multipart/mixed; boundary="==="

                --===
                Content-Type: text/plain
                Content-Disposition: InLine

                simple body

                --===
                Content-Type: text/html
                Content-Disposition: inline

                <p>simple body</p>

                --===--
                )rr)Na�                To: foo@example.com
                MIME-Version: 1.0
                Content-Type: multipart/related; boundary="==="; type=text/html

                --===
                Content-Type: text/html

                <p>simple body</p>

                --===
                Content-Type: image/jpg
                Content-ID: <image1>

                bogus data

                --===--
                )rr(Na                To: foo@example.com
                MIME-Version: 1.0
                Content-Type: multipart/related; boundary="==="; type=text/html;
                 start="<body>"

                --===
                Content-Type: text/html
                Content-ID: <include>

                useless text

                --===
                Content-Type: text/html
                Content-ID: <body>

                <p>simple body</p>
                <!--#include file="<include>"-->

                --===--
                )��r()��)r)r,r-a�                To: foo@example.com
                MIME-Version: 1.0
                Content-Type: multipart/mixed; boundary="==="

                --===
                Content-Type: multipart/alternative; boundary="+++"

                --+++
                Content-Type: text/plain

                simple body

                --+++
                Content-Type: multipart/related; boundary="___"

                --___
                Content-Type: text/html

                <p>simple body</p>

                --___
                Content-Type: image/jpg
                Content-ID: <image1@cid>

                bogus jpg body

                --___--

                --+++--

                --===
                Content-Type: image/jpg
                Content-Disposition: attachment

                bogus jpg body

                --===
                Content-Type: image/jpg
                Content-Disposition: AttacHmenT

                another bogus jpg body

                --===--
                )r)r+r*a�                To: foo@example.com
                MIME-Version: 1.0
                Content-Type: multipart/mixed; boundary="==="

                --===
                Content-Type: multipart/related; boundary="+++"

                --+++
                Content-Type: multipart/alternative; boundary="___"

                --___
                Content-Type: text/plain

                simple body

                --___
                Content-Type: text/html

                <p>simple body</p>

                --___--

                --+++
                Content-Type: image/jpg
                Content-ID: <image1@cid>

                bogus jpg body

                --+++--

                --===
                Content-Type: image/jpg
                Content-Disposition: attachment

                bogus jpg body

                --===
                Content-Type: image/jpg
                Content-Disposition: attachment

                another bogus jpg body

                --===--
                )r)NNa�                To: foo@example.com
                MIME-Version: 1.0
                Content-Type: multipart/mixed; boundary="==="

                --===
                Content-Type: multipart/related; boundary="+++"

                --+++
                Content-Type: image/jpg
                Content-ID: <image1@cid>

                bogus jpg body

                --+++
                Content-Type: multipart/alternative; boundary="___"

                --___
                Content-Type: text/plain

                simple body

                --___
                Content-Type: text/html

                <p>simple body</p>

                --___--

                --+++--

                --===
                Content-Type: image/jpg
                Content-Disposition: attachment

                bogus jpg body

                --===
                Content-Type: image/jpg
                Content-Disposition: attachment

                another bogus jpg body

                --===--
                z�                To: foo@example.com
                MIME-Version: 1.0
                Content-Type: message/rfc822

                To: bar@example.com
                From: robot@examp.com

                this is a message body.
                a�                To: foo@example.com
                MIME-Version: 1.0
                Content-Type: multipart/mixed; boundary="==="

                --===
                Content-Type: text/plain

                Your message has bounced, ser.

                --===
                Content-Type: message/rfc822

                To: bar@example.com
                From: robot@examp.com

                this is a message body.

                --===--
                )Z
empty_messageZnon_mime_plainZ
mime_non_textZplain_html_alternativeZplain_html_mixedZplain_html_attachment_mixedZhtml_text_attachment_mixedZ!html_text_attachment_inline_mixed�relatedZrelated_with_startZmixed_alternative_plain_relatedZ$mixed_related_alternative_plain_htmlZ0mixed_related_alternative_plain_html_wrong_orderZmessage_rfc822Zmixed_text_message_rfc822c
s�|�|�}t|�����fdd�|D�}d}d}d}	|�|��t|��|�|jdd�t|��|�|jdd�t|||d���|�|jd	d�t||||	g��|�|jd
d�t|||	d���|�|jdgd�||�|�|jdgd�||�|�|jd
gd�||	�|�|jdd�t||	|dd���|�|jdd�t||	||g��|�|jdd�t||dd���|�|jdd�t|ddd���|�|jdd�t||||	||g��dS)Ncs g|]}|dkrdn�|�qSrr	��.0�n�Zallpartsr	r�
<listcomp>�sz<TestEmailMessageBase.message_as_get_body.<locals>.<listcomp>rr)r()r.�html�plain)Zpreferencelist)r.r4)r.r5)r4r5r.r4r5)r5r4���)r5r.)r4r.)r5r4r.)r4r5r.)r�list�walkr!Zget_bodyr)
r�
body_parts�attachments�parts�msgrZexpectedr.r4r5r	r2r�message_as_get_body�sT
�����������z(TestEmailMessageBase.message_as_get_bodycs@|�|�}t|�����fdd�|D�}|�t|���|�dS)Ncsg|]}�|�qSr	r	r/r2r	rr3�szCTestEmailMessageBase.message_as_iter_attachment.<locals>.<listcomp>)rr7r8r!�iter_attachments�rr9r:r;r<rr	r2r�message_as_iter_attachment�s
z/TestEmailMessageBase.message_as_iter_attachmentcs@|�|�}t|�����fdd�|D�}|�t|���|�dS)Ncsg|]}�|�qSr	r	r/r2r	rr3�sz>TestEmailMessageBase.message_as_iter_parts.<locals>.<listcomp>)rr7r8r!�
iter_partsr?r	r2r�message_as_iter_parts�s
z*TestEmailMessageBase.message_as_iter_partsc@seZdZdd�Zdd�ZdS)z(TestEmailMessageBase._TestContentManagercOs
|||fSrr	�rr<�args�kwr	r	r�get_content�sz4TestEmailMessageBase._TestContentManager.get_contentcOs||_||_||_dSr)r<rDrErCr	r	r�set_content�sz4TestEmailMessageBase._TestContentManager.set_contentN)r#r$r%rFrGr	r	r	r�_TestContentManager�srHcCst|�d�}|��}|�|j|d�|dif�|jd|ddd�\}}}|�||�|�|d�|�|tddd	��dS�
Nr��content_managerr	�foor)r()rK�bar�k�rL�rMrN)rrHr!rF�dict)rr�cmr<rDrEr	r	r�test_get_content_with_cm�s
z-TestEmailMessageBase.test_get_content_with_cmcCs|tjj|��d�}|jd|d�}|�|��|dif�|jdddd�\}}}|�||�|�|d	�|�|tddd��dS�
NrJrrr	rLr)r(rPrO)rr �clonerHrr!rFrQ)r�prr<rDrEr	r	r�-test_get_content_default_cm_comes_from_policyszBTestEmailMessageBase.test_get_content_default_cm_comes_from_policycCs�|�d�}|��}|j|d�|�|j|�|�|jd�|�|ji�|jd|ddd�|�|j|�|�|jd�|�|jtddd	��dSrI)rrHrGr!r<rDrErQ�rrrRr	r	r�test_set_content_with_cm	s
z-TestEmailMessageBase.test_set_content_with_cmcCs�|��}tjj|d�}|jd|d�}|��|�|j|�|�|jd�|�|j	i�|jdddd�|�|j|�|�|jd	�|�|j	t
ddd��dSrT)rHrr rUrrGr!r<rDrErQ)rrRrVrr	r	r�-test_set_content_default_cm_comes_from_policyszBTestEmailMessageBase.test_set_content_default_cm_comes_from_policy))r.�
no_content�succeeds)r.�noner\)r.r5r\)r.r.r)r.�alternative�raises)r.�mixedr_)r^r[r\)r^r]r\)r^r5r\)r^r.r\)r^r^r)r^r`r_)r`r[r\)r`r]r\)r`r5r\)r`r.r\)r`r^r\)r`r`rcCs�|��}d}ddg}|dkr|�d�|dkrHd}|�d�|�d�n|dkrfg}|�dd	|f�|�d
�|�|�|D]\}}|||<q~|||fS)N)rzfoo@bar.com)ZFromzbar@foo.comr[)zX-Random-HeaderZCorwin�textr)�Content-Type�
text/plainrb�
multipart/)zX-TrumpZRandom)�message�append�set_payload)r�subtyper�payload�msg_headers�name�valuer	r	r�_make_subtype_test_message=s&�




z/TestEmailMessageBase._make_subtype_test_messagec	CsH|�t��}t||��W5QRXt|j�}|�||�|�||�dSr)rr�getattr�str�	exceptionZassertIn)rrZmethod_namerh�method�arZexc_textr	r	r� _check_disallowed_subtype_raisesTs

z5TestEmailMessageBase._check_disallowed_subtype_raisescCs�d}|D].\}}|���d�s|�|||�|d7}q|�t|�|d�t|���}d}|D].\}}|���d�r`|�|||�|d7}q`|�t|�|�|�|��|�dS)Nr�content-r))�lower�
startswithr!�lenrrA�get_payload)rrrjri�countrkrl�partr	r	r�_check_make_multipart[s

z*TestEmailMessageBase._check_make_multipartcCs�|�|�\}}}d|}|dkr4|�||||�dSt||��|�|��d�|�|��|�|dkr�|�t|���d�|�|��|dd|fg�n"|�t|���d�|�	|||�dS)	N�make_�rr_�	multipartr[rrbrdr))
rmrsrnr!�get_content_maintype�get_content_subtyperwrx�itemsr{)rrqrh�outcomerrjriZmake_methodr	r	r�subtype_as_makeks"
��z$TestEmailMessageBase.subtype_as_makec	Cs�|��}|dkrFd||d<|�t��}t|d|��W5QRXdS|dkrXd|d<n|dkrld||d<t|d|�dd	�|�|���|�|��d�dS)
Nr}rdrbr|r5rcr[�abc)�boundary)rerrrn�
assertTrueZis_multipartr!Zget_boundary)rrqrhr�rrRr	r	r�subtype_as_make_with_boundary}s
z2TestEmailMessageBase.subtype_as_make_with_boundarycCsNdD]D}|j|jjdd�d�}d|d<t||��|�|�d�jjd�qdS)N)Zmake_relatedZmake_alternativeZ
make_mixedrLrJrrcrbr)rerrUrnr!rxrK)rrqrr	r	r�3test_policy_on_part_made_by_make_comes_from_message�s
zHTestEmailMessageBase.test_policy_on_part_made_by_make_comes_from_messagec@seZdZdd�ZdS)z+TestEmailMessageBase._TestSetContentManagercOsd|d<|�|�dS)Nrcrb)rg�rr<ZcontentrDrEr	r	rrG�sz7TestEmailMessageBase._TestSetContentManager.set_contentN�r#r$r%rGr	r	r	r�_TestSetContentManager�sr�cCsb|�|�\}}}|��}|dkr$dnd|}|dkrH|�||||�dSt||�d|d�|�|��d�|�|��|�||ks�|dkr�|�t|���d	�|D]\}	}
|�||	|
�q�|��d
}n.|�t|���d�|�	|||�|��d	}|�|�
�d�|�|��d�|dk�r4|�|d
d�n*|dk�rP|�|d
d�n|�|d
�dS)Nr`�add_attachmentZadd_r_�testrJr~r[r)rr(rc�Content-Disposition�
attachmentr.�inline)rmr�rsrnr!rr�rwrxr{Zget_content_type�assertIsNone)rrqrhr�rrjrirRZ
add_methodrkrlrzr	r	r�subtype_as_add�s0

z#TestEmailMessageBase.subtype_as_addc@seZdZdd�ZdS)z2TestEmailMessageBase._TestSetRaisingContentManagercOstd��dS)Nr�)�	Exceptionr�r	r	rrG�sz>TestEmailMessageBase._TestSetRaisingContentManager.set_contentNr�r	r	r	r�_TestSetRaisingContentManager�sr�c
Csb|��}|j|jj|d�d�}dD]:}|�t��}t||�d�W5QRX|�t|j	�d�q"dS)NrJr)�add_relatedZadd_alternativer�rr�)
r�rerrUrr�rnr!rorp)rrRrrqrrr	r	r�6test_default_content_manager_for_add_comes_from_policy�szKTestEmailMessageBase.test_default_content_manager_for_add_comes_from_policycCs\|�|�}|��|�t|�d�|�t|���g�|�|���|�t|���g�dS)Nr)	r�clearr!rwr7r�r�rxrAr?r	r	r�message_as_clear�s
z%TestEmailMessageBase.message_as_clearcCs^|�|�}dd�|��D�}|��|�t|���|�|�|���|�t|���g�dS)NcSsg|]}|���d�s|�qS)rt)rurv)r0�hr	r	rr3�s�zATestEmailMessageBase.message_as_clear_content.<locals>.<listcomp>)r�keysZ
clear_contentr!r7r�rxrA)rr9r:r;r<rZexpected_headersr	r	r�message_as_clear_content�s
z-TestEmailMessageBase.message_as_clear_contentcCs�|��}|�|���d|d<|�|���|�dd�|�|���|�dd�|�|���|�ddd�|�|���dS)Nr�r�r�Z
AtTachMent�filenamezabc.png)�
_make_messageZassertFalseZ
is_attachmentZreplace_headerr�Z	set_paramrr	r	r�test_is_attachment�sz'TestEmailMessageBase.test_is_attachmentcCs^|��}|�d�|�d�|�d�|����}|�tt|����d�|�|��|�dS)Nzarbitrary text as main partzmore text as a related partz&yet more text as a second "attachment"r()	r�rGr�rx�copyr!rwr7r>)rrZorigr	r	r�test_iter_attachments_mutation�s


z3TestEmailMessageBase.test_iter_attachments_mutationN)r#r$r%rr rrZmessage_paramsr=r@rBrHrSrWrYrZZsubtype_paramsrmrsr{r�r�r�r�r�r�r�r�r�r�r�r	r	r	rr&&s���
��������5�6�3����� 			r&c@s�eZdZeZdd�ZGdd�d�Zdd�Zdd�Zd	d
�Z	dd�Z
d
d�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�ZdS) �TestEmailMessagecCs>|�d�}|��}|�d|�|j|d�|�|dd�dS�Nr�MIME-VersionrJ�1.0)rrH�assertNotInrGr!rXr	r	r�"test_set_content_adds_MIME_Version�s

z3TestEmailMessage.test_set_content_adds_MIME_Versionc@seZdZdd�ZdS)z(TestEmailMessage._MIME_Version_adding_CMcOsd|d<dS)Nr�r�r	rCr	r	rrG�sz4TestEmailMessage._MIME_Version_adding_CM.set_contentNr�r	r	r	r�_MIME_Version_adding_CM�sr�cCs>|�d�}|��}|�d|�|j|d�|�|dd�dSr�)rr�r�rGr!rXr	r	r�0test_set_content_does_not_duplicate_MIME_Version�s

zATestEmailMessage.test_set_content_does_not_duplicate_MIME_VersioncCs*|�d�}|�t|�������d�dS�N��Subject: long line ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab

r*�rr!rwZ	as_string�strip�
splitlinesrr	r	r�0test_as_string_uses_max_header_length_by_default�s
zATestEmailMessage.test_as_string_uses_max_header_length_by_defaultcCsN|�d�}|�t|jdd������d�|�t|jdd������d�dS)Nr�r)Zmaxheaderlenr)�"r,r�rr	r	r�"test_as_string_allows_maxheaderlens
��z3TestEmailMessage.test_as_string_allows_maxheaderlencCs*|�d�}|�tt|������d�dSr�)rr!rwror�r�rr	r	r�+test_str_defaults_to_policy_max_line_length
s
z<TestEmailMessage.test_str_defaults_to_policy_max_line_lengthcCs"t�}d|d<|�t|�d�dS)Nuunicöde�SubjectuSubject: unicöde

)rr!rorr	r	r�test_str_defaults_to_utf8sz*TestEmailMessage.test_str_defaults_to_utf8cCs"t�}d|d<|�t|�d�dS)NuDHello Wörld! Hello Wörld! Hello Wörld! Hello Wörld!Hello Wörld!r�s|Subject: Hello =?utf-8?q?W=C3=B6rld!_Hello_W=C3=B6rld!_Hello_W=C3=B6rld!?=
 Hello =?utf-8?q?W=C3=B6rld!Hello_W=C3=B6rld!?=

�rr!�bytesrr	r	r�!test_folding_with_utf8_encoding_1s

�z2TestEmailMessage.test_folding_with_utf8_encoding_1cCs"t�}d|d<|�t|�d�dS)NuHHello Wörld! Hello Wörld! Hello Wörlds123! Hello Wörld!Hello Wörld!r�s�Subject: Hello =?utf-8?q?W=C3=B6rld!_Hello_W=C3=B6rld!_Hello_W=C3=B6rlds123!?=
 Hello =?utf-8?q?W=C3=B6rld!Hello_W=C3=B6rld!?=

r�rr	r	r�!test_folding_with_utf8_encoding_2$s

�z2TestEmailMessage.test_folding_with_utf8_encoding_2cCs"t�}d|d<|�t|�d�dS)NuHHello-Wörld!-Hello-Wörld!-Hello-Wörlds123! Hello Wörld!Hello Wörld!r�s�Subject: =?utf-8?q?Hello-W=C3=B6rld!-Hello-W=C3=B6rld!-Hello-W=C3=B6rlds123!?=
 Hello =?utf-8?q?W=C3=B6rld!Hello_W=C3=B6rld!?=

r�rr	r	r�!test_folding_with_utf8_encoding_34s

�z2TestEmailMessage.test_folding_with_utf8_encoding_3cCs"t�}d|d<|�t|�d�dS)NuHHello-Wörld!-Hello-Wörld!-Hello-Wörlds123!-Hello Wörld!Hello Wörld!r�s�Subject: =?utf-8?q?Hello-W=C3=B6rld!-Hello-W=C3=B6rld!-Hello-W=C3=B6rlds123!?=
 =?utf-8?q?-Hello_W=C3=B6rld!Hello_W=C3=B6rld!?=

r�rr	r	r�!test_folding_with_utf8_encoding_4Ds

�z2TestEmailMessage.test_folding_with_utf8_encoding_4cCs"t�}d|d<|�t|�d�dS)NuS123456789 123456789 123456789 123456789 123456789 123456789 123456789 Hello Wörld!r�soSubject: 123456789 123456789 123456789 123456789 123456789 123456789 123456789
 Hello =?utf-8?q?W=C3=B6rld!?=

r�rr	r	r�!test_folding_with_utf8_encoding_5Ts

�z2TestEmailMessage.test_folding_with_utf8_encoding_5cCs"t�}d|d<|�t|�d�dS)Nuq123456789 123456789 123456789 123456789 Hello Wörld! 123456789 123456789 123456789 123456789 123456789 123456789r�s�Subject: 123456789 123456789 123456789 123456789 Hello =?utf-8?q?W=C3=B6rld!?=
 123456789 123456789 123456789 123456789 123456789 123456789

r�rr	r	r�!test_folding_with_utf8_encoding_6bs

�z2TestEmailMessage.test_folding_with_utf8_encoding_6cCs"t�}d|d<|�t|�d�dS)Nuo123456789 123456789 Hello Wörld! Hello Wörld! 123456789-123456789 123456789 Hello Wörld! 123456789 123456789r�s�Subject: 123456789 123456789 Hello =?utf-8?q?W=C3=B6rld!_Hello_W=C3=B6rld!?=
 123456789-123456789 123456789 Hello =?utf-8?q?W=C3=B6rld!?= 123456789
 123456789

r�rr	r	r�!test_folding_with_utf8_encoding_7rs

�z2TestEmailMessage.test_folding_with_utf8_encoding_7cCs"t�}d|d<|�t|�d�dS)Nu�123456789 123456789 Hello Wörld! Hello Wörld! 123456789 123456789 123456789 123456789 123456789 123456789-123456789 123456789 Hello Wörld! 123456789 123456789r�s�Subject: 123456789 123456789 Hello =?utf-8?q?W=C3=B6rld!_Hello_W=C3=B6rld!?=
 123456789 123456789 123456789 123456789 123456789 123456789-123456789
 123456789 Hello =?utf-8?q?W=C3=B6rld!?= 123456789 123456789

r�rr	r	r�!test_folding_with_utf8_encoding_8�s

�z2TestEmailMessage.test_folding_with_utf8_encoding_8N)r#r$r%rrer�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r	r	r	rr��s r�c@s eZdZeZdd�Zdd�ZdS)�TestMIMEPartcCs:|�d�}|��}|�d|�|j|d�|�d|�dS)Nrr�rJ)rrHr�rGrXr	r	r�*test_set_content_does_not_add_MIME_Version�s

z7TestMIMEPart.test_set_content_does_not_add_MIME_VersioncCs0tt�d�tjd�}|��}|�t|�g�dS)NzT        Content-Type: multipart/mixed; charset="utf-8"

        sample text
        r)rrrrr r>r!r7)rr<r:r	r	r�/test_string_payload_with_multipart_content_type�s

�z<TestMIMEPart.test_string_payload_with_multipart_content_typeN)r#r$r%rrer�r�r	r	r	rr��sr��__main__)ZunittestrZemailrrZ
email.messagerrZtest.test_emailrrrrr&r�r�r#�mainr	r	r	r�<module>s$H.