403Webshell
Server IP : 121.121.20.254  /  Your IP : 216.73.216.202
Web Server : Microsoft-IIS/10.0
System : Windows NT WEB-SERVER 10.0 build 20348 (Windows Server 2022) AMD64
User : IUSR ( 0)
PHP Version : 8.3.28
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  C:/Python313/Lib/test/test_email/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : C:/Python313/Lib/test/test_email/__pycache__/test_email.cpython-313.opt-2.pyc
�

��i`���8�SSKrSSKrSSKrSSKrSSKrSSKJrJr SSKJ	r	 SSK
Jr SSKJ
r
 SSKJr SSKrSSKrSSKrSSKJr SSKJrJrJr SS	KJrJrJr SS
KJr SSKJ r  SSK!J"r" SS
K#J$r$ SSK%J&r& SSK'J(r( SSK)J*r* SSK+J,r, SSK-J.r. SSK/J0r0 SSK1J2r2J3r3 SSKJ4r4 SSKJ5r5 SSKJ6r6 SSKJ7r7 SSKJ8r8 SSKJ9r9 SSK:J;r; SSK<J=r= SSK>J?r? SSK@JArAJBrB SSK1JCrC S rDS!rES"rF"S#S$\B5rG"S%S&\R�5rI"S'S(\B5rJ"S)S*\R�5rK"S+S,\R�5rL"S-S.\R�5rM"S/S0\R�5rN"S1S2\R�5rO"S3S4\B5rP"S5S6\B5rQ"S7S8\B5rR"S9S:\B5rS"S;S<\B5rT"S=S>\B5rU"S?S@\B5rV"SASB\B5rW"SCSD\B5rX"SESF\B5rY"SGSH\B5rZ"SISJ5r["SKSL\[\U5r\"SMSN\[\U5r]"SOSP\R�5r^"SQSR\R�5r_"SSST\R�5r`"SUSV\B5ra"SWSX\B5rb"SYSZ\B5rc"S[S\\B5rd\eS]:Xa\R�"5 gg)^�N)�StringIO�BytesIO)�chain��choice)�Thread)�patch)�Charset)�	Generator�DecodedGenerator�BytesGenerator)�Header�
decode_header�make_header)�HeaderRegistry)�Message)�MIMEApplication)�	MIMEAudio)�MIMEBase)�	MIMEImage)�MIMEMessage)�
MIMEMultipart)�MIMENonMultipart)�MIMEText)�Parser�HeaderParser)�
base64mime)�encoders��errors)�	iterators)�
quoprimime)�utils)�support)�threading_helper)�unlink)�openfile�
TestEmailBase)�
FeedParser�
�� c�0�\rSrSrSrSrSrSrSrSr	Sr
S	rS
rSr
SrS
rSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSr Sr!S r"S!r#S"r$S#r%S$r&S%r'S&r(S'r)S(r*S)r+S*r,S+r-S,r.S-r/S.r0S/r1S0r2S1r3S2r4S3r5S4r6S5r7S6r8S7r9S8r:S9r;S:r<S;r=S<r>S=r?S>r@S?rAS@rBSArCSBrDSCrESDrFSErGSFrHSGrISHrJSIrKSJrLSKrMSLrNSMrOSNrPSOrQSPrRSQrSSRrTSSrUSTrVSUrWSVrXSWrYSXrZSYr[SZr\S[r]S\r^g])^�TestMessageAPI�9c��URnURS5nU"URS5/SQ5 U"URSS5S5 g)Nz
msg_20.txt�cc)zccc@zzz.orgzddd@zzz.orgzeee@zzz.org�xxzn/a)�assertEqual�_msgobj�get_all��self�eq�msgs   �/C:\Python313\\Lib\test\test_email\test_email.py�test_get_all�TestMessageAPI.test_get_all:sD��
�
�
���l�l�<�(��
�3�;�;�t��K�L�
�3�;�;�t�U�#�U�+�c��URn[5nU"UR5S5 [S5nUR	U5 U"USS5 U"UR5S5 U"USS5 U"UR
S5S5 U"USS	5 U"UR5RS5 UR	S5 U"UR5S5 U"USS5 [5nS
US'SUS
'SUS'UR	U5 U"USS
5 U"USS5 U"USS5 g)N�
iso-8859-1�mime-versionz1.0�
text/plain�content-typez text/plain; charset="iso-8859-1"�charset�content-transfer-encoding�quoted-printablez2.0zMIME-Versionztext/x-weird�Content-Typezquinted-puntable�Content-Transfer-Encodingz"text/x-weird; charset="iso-8859-1")r3r�get_charsetr
�set_charset�get_content_type�	get_param�
input_charset�r7r8r9rCs    r:�test_getset_charset�"TestMessageAPI.test_getset_charset@s6��
�
�
���i��
�3�?�?��d�#��,�'������ �
�3�~���&�
�3���!�<�0�
�3�~�� B�C�
�3�=�=��#�\�2�
�3�*�+�-?�@�
�3�?�?��*�*�L�9������
�3�?�?��d�#�
�3�~���-��i��#��N��,��N��+=��'�(����� �
�3�~���&�
�3�~�� D�E�
�3�*�+�-?�@r=c��URn[5nURS5 U"UR5RS5 U"USS5 g)N�us-asciirB�text/plain; charset="us-ascii")r3rrIrHrLr6s   r:�test_set_charset_from_string�+TestMessageAPI.test_set_charset_from_stringZsG��
�
�
���i�����
�#�
�3�?�?��*�*�J�7�
�3�~�� @�Ar=c��[5n[S5nURSU5 URUR	5R
S5 g)Nr?zThis is a string payload)rr
�set_payloadr3rHrL)r7r9rCs   r:�test_set_payload_with_charset�,TestMessageAPI.test_set_payload_with_charsetas?���i���,�'�����2�G�<�������*�8�8�,�Gr=c��Sn[S5n[5nURX5 URUSS5 URUR	SS9U5 URUR	5S5 g)N�АБВ�utf-8rD�base64T��decodez	0JDQkdCS
)r
rrVr3�get_payload�r7�datarCr9s    r:�+test_set_payload_with_8bit_data_and_charset�:TestMessageAPI.test_set_payload_with_8bit_data_and_charsetgsl��*���'�"���i������&�����8�9�8�D���������5�t�<�������*�L�9r=c���Sn[S5nSUl[5nURUR	S5U5 URUSS5 URUR
SS9U5 g�NrZr[rD�8bitTr])r
�
body_encodingrrVr^r3r_r`s    r:�>test_set_payload_with_non_ascii_and_charset_body_encoding_none�MTestMessageAPI.test_set_payload_with_non_ascii_and_charset_body_encoding_nonepsh��*���'�"�� $����i��������G�,�g�6�����8�9�6�B���������5�t�<r=c���Sn[S5nSUl[5nURX5 UR	USS5 UR	URSS9U5 gre)r
rgrrVr3r_r`s    r:�>test_set_payload_with_8bit_data_and_charset_body_encoding_none�MTestMessageAPI.test_set_payload_with_8bit_data_and_charset_body_encoding_noneys]��*���'�"�� $����i������&�����8�9�6�B���������5�t�<r=c�z�[5nUR/5 URUR5/5 g�N�rrVr3r_�r7r9s  r:�test_set_payload_to_list�'TestMessageAPI.test_set_payload_to_list�s,���i�������������*�B�/r=c��[5nSUS'URS5 [[55nUR[SUR
U5 g)N�multipart/mixedrFzstring payloadz[Aa]ttach.*non-multipart)rrVr�assertRaisesRegex�	TypeError�attach)r7r9�sub_msgs   r:�"test_attach_when_payload_is_string�1TestMessageAPI.test_attach_when_payload_is_string�sH���i��/��N�����(�)��g�i�(�����y�*D�"�z�z�7�	4r=c�&�URnURS5nUR5nU"U/SQ5 URS5nURS5nU"U/SQ5 URS5nUR5nU"U/SQ5 g)Nz
msg_08.txt)NrQr?�
iso-8859-2�koi8-rz
msg_09.txt�dingbat)r~rQr?r~r}z
msg_12.txt)NrQr?Nr|z
iso-8859-3rQr})r3r4�get_charsets)r7r8r9�charsetss    r:�test_get_charsets� TestMessageAPI.test_get_charsets�s���
�
�
���l�l�<�(���#�#�%��
�8�M�N��l�l�<�(���#�#�I�.��
�8� �	!��l�l�<�(���#�#�%��
�8�:�	;r=c�*�URnURS5nUR5Vs/sHo3R5PM nnU"USS/5 URS5nURS5nU"UR5S5 gs snf)N�
msg_04.txt�msg.txt�
msg_07.txt��dingusfish.gif�r3r4r_�get_filename)r7r8r9�p�	filenames�subparts      r:�test_get_filename� TestMessageAPI.test_get_filename�s���
�
�
���l�l�<�(��/2���/@�A�/@�!�^�^�%�/@�	�A�
�9�y�)�,�-��l�l�<�(���/�/�!�$��
�7���!�#3�4��Bs�Bc��URnURS5nUR5Vs/sHo3R5PM nnU"USS/5 gs snf)Nz
msg_44.txtr�r�)r7r8r9r�r�s     r:�%test_get_filename_with_name_parameter�4TestMessageAPI.test_get_filename_with_name_parameter�sR��
�
�
���l�l�<�(��/2���/@�A�/@�!�^�^�%�/@�	�A�
�9�y�)�,�-��Bs�Ac�l�URnURS5nU"UR5S5 g)Nr��BOUNDARY)r3r4�get_boundaryr6s   r:�test_get_boundary� TestMessageAPI.test_get_boundary�s.��
�
�
���l�l�<�(��
�3����z�*r=c���URnURS5nURS5 UR5Sup4U"UR	5S5 U"US5 URS5nURS5 UR5Sup4U"UR	5S5 U"US5 URS5nUR[RURS5 g)	N�
msg_01.txtr��rBz3text/plain; charset="us-ascii"; boundary="BOUNDARY"r�z$multipart/mixed; boundary="BOUNDARY"�
msg_03.txt)r3r4�set_boundary�items�lower�assertRaisesr �HeaderParseError)r7r8r9�header�values     r:�test_set_boundary� TestMessageAPI.test_set_boundary�s���
�
�
���l�l�<�(������$��	�	��A��
��
�6�<�<�>�>�*�
�5�G�H��l�l�<�(������$��	�	��A��
��
�6�<�<�>�>�*�
�5�8�9��l�l�<�(�����&�1�1��*�*�J�	8r=c���[S5nURUR5SSS5 UR5 UR	UR5SSS5 g)Nz	form-datarr�zmultipart/form-dataz!multipart/form-data; boundary="==)rr3r��	as_string�assertStartsWithrps  r:�test_make_boundary�!TestMessageAPI.test_make_boundary�sZ���K�(��	
�������Q���*�,A�B��
�
�����c�i�i�k�!�n�Q�/�A�	Cr=c�4�[SSS9nUR5nSSS5 [5nURW5n[	5n[USS5nUR
US5 URUR5U5 g!,(df   Ns=f)N�
msg_46.txtr[��encodingTrF)	r'�readr�parsestrrr�flattenr3�getvalue�r7�fp�msgdata�parserr9�out�gens       r:�test_message_rfc822_only�'TestMessageAPI.test_message_rfc822_only�sw���l�W�
5���g�g�i�G�6�����o�o�g�&���j����T�1�%�����C�����������1�6�
5�s�B	�	
Bc��[SSS9nUR5RS5nSSS5 [RR5nUR
W5n[5n[RRU5nURU5 URUR5U5 g!,(df   N�=f)Nr�r[r��ascii)
r'r��encode�emailr��BytesHeaderParser�
parsebytesr�	generatorr
r�r3r�r�s       r:�test_byte_message_rfc822_only�,TestMessageAPI.test_byte_message_rfc822_only�s���
�l�W�
5���g�g�i�&�&�w�/�G�6����/�/�1������(���i���o�o�,�,�S�1�����C����������1�6�
5�s� B=�=
Cc���URnURS5nU"URSS9S5 U"URS5RSS9S5 U"URS5RSS9S5 U"URS5RSS9S	5 U"URS
5RSS9S5 U"URS5RSS9S
5 g)Nz
msg_10.txtTr]rs This is a 7bit encoded message.
r�s-�This is a Quoted Printable encoded message!
�s!This is a Base64 encoded message.�s"This is a Base64 encoded message.
r�s/This has no Content-Transfer-Encoding: header.
)r3r4r_r6s   r:�test_get_decoded_payload�'TestMessageAPI.test_get_decoded_payload�s���
�
�
���l�l�<�(��
�3�?�?�$�?�'��.�
�3�?�?�1��)�)��)�6�/�	1�	�3�?�?�1��)�)��)�6�?�	A�	�3�?�?�1��)�)��)�6�/�	1�	�3�?�?�1��)�)��)�6�1�	3�	�3�?�?�1��)�)��)�6�>�	@r=c���URn[5nURS5 SHnX2S'U"URSS9S5 M URS5 U"URSS9S5 g)	Nz$begin 666 -
+:&5L;&\@=V]R;&0 
 
end
�z
x-uuencode�uuencode�uuezx-uuerDTr]�hello world�foosfoo)r3rrVr_)r7r8r9�ctes    r:�test_get_decoded_uu_payload�*TestMessageAPI.test_get_decoded_uu_payloadsl��
�
�
���i�����C�D�=�C�/2�+�,��s���d��+�^�<�>�	�����
�3�?�?�$�?�'��0r=c�Z�[5nUR[URS5 g)Nr�)rr�rvr_rps  r:�*test_get_payload_n_raises_on_non_multipart�9TestMessageAPI.test_get_payload_n_raises_on_non_multiparts���i�����)�S�_�_�a�8r=c� �URnURS5n[SSS9nUR5nSSS5 [	5n[U5nUR
U5 U"UR5W5 g!,(df   NL=f)Nr�z
msg_17.txtr[r�)r3r4r'r�rrr�r�)r7r8r9r��text�s�gs       r:�test_decoded_generator�%TestMessageAPI.test_decoded_generatorsl��
�
�
���l�l�<�(��
�l�W�
5���7�7�9�D�6��J���Q���	�	�	�#��
�1�:�:�<���6�
5�s�A?�?
B
c��[5nSUS'SUS'URSU5 URSU5 URSU5 URSU5 URSU5 URSU5 g)	N�Me�From�You�to�from�FROM�To�TO)r�assertInrps  r:�test__contains__�TestMessageAPI.test__contains__so���i����F����D�	��
�
�f�c�"��
�
�f�c�"��
�
�f�c�"��
�
�d�C� ��
�
�d�C� ��
�
�d�C� r=c�~�URS5n[SSS9nUR5nSSS5 URW[	U55 URSS9nUR
S5nURUSS5 URU[RUS	S55 g!,(df   N�=f)
Nr�r[r�T��unixfromr*rzFrom r�)
r4r'r�r3�strr��splitr��NL�join)r7r9r�r��fullrepr�liness      r:�test_as_string�TestMessageAPI.test_as_string+s����l�l�<�(��
�l�W�
5���7�7�9�D�6�����s�3�x�(��=�=�$�=�/�����t�$�����e�A�h��0�����r�w�w�u�Q�R�y�1�2�
6�
5�s�B.�.
B<c��URS5nURRSS9nURUS9n[	5n[XBS9nUR
U5 URX4R55 g�Nr��
��linesep��policy)	r4r��cloner�rrr�r3r��r7r9�	newpolicyr�r�r�s      r:�test_as_string_policy�$TestMessageAPI.test_as_string_policy5sg���l�l�<�(���J�J�$�$�V�$�4�	��=�=�	�=�2���J���a�*��	�	�	�#������:�:�<�0r=c���[R"S5nURS5n[R"S5n[R"U5nURUR
5U5 g)Nu�            MIME-Version: 1.0
            Content-type: text/plain; charset="iso-8859-1"

            Test if non-ascii messages with no Content-Transfer-Encoding set
            can be as_string'd:
            Föö bär
            r?a%            MIME-Version: 1.0
            Content-type: text/plain; charset="iso-8859-1"
            Content-Transfer-Encoding: quoted-printable

            Test if non-ascii messages with no Content-Transfer-Encoding set
            can be as_string'd:
            F=F6=F6 b=E4r
            )�textwrap�dedentr�r��message_from_bytesr3r��r7�m�source�expectedr9s     r:�#test_nonascii_as_string_without_cte�2TestMessageAPI.test_nonascii_as_string_without_cte>s`���O�O��
�����,�'���?�?�$����&�&�v�.���������(�3r=c���[R"S5nURS5nURSS5n[R
"U5nUR
UR5U5 g)Nu            MIME-Version: 1.0
            Content-type: text/plain; charset="us-ascii"
            Content-Transfer-Encoding: 8bit

            Test if non-ascii messages with no Content-Transfer-Encoding set
            can be as_string'd:
            Föö bär
            r?r��replace�r�r�r�r^r�rr3r�rs     r:�*test_nonascii_as_string_with_ascii_charset�9TestMessageAPI.test_nonascii_as_string_with_ascii_charsetTs[���O�O��
�����,�'���=�=��)�4���&�&�v�.���������(�3r=c���[R"S5nURS5nURSS5n[R
"U5nUR
UR5U5 g)Nu�            MIME-Version: 1.0

            Test if non-ascii messages with no Content-Type nor
            Content-Transfer-Encoding set can be as_string'd:
            Föö bär
            r?r�rr	rs     r:�4test_nonascii_as_string_without_content_type_and_cte�CTestMessageAPI.test_nonascii_as_string_without_content_type_and_ctecs[���O�O��
�����,�'���=�=��)�4���&�&�v�.���������(�3r=c��URS5n[SSS9nUR5RS5nSSS5 UR	W[U55 UR
SS9nURS5nURUSS	5 UR	USRUS
S55 g!,(df   N�=f)Nr�r[r�r�Tr��
rsFrom r�)
r4r'r�r�r3�bytes�as_bytesr�r�r�)r7r9r�rar�r�s      r:�
test_as_bytes�TestMessageAPI.test_as_bytesps����l�l�<�(��
�l�W�
5���7�7�9�#�#�G�,�D�6�����u�S�z�*��<�<��<�.�����u�%�����e�A�h��1�����u�z�z�%���)�4�5�
6�
5�s� B9�9
Cc��URS5nURRSS9nURUS9n[	5n[XBS9nUR
U5 URX4R55 gr�)	r4r�r�rrr
r�r3r�r�s      r:�test_as_bytes_policy�#TestMessageAPI.test_as_bytes_policyzsg���l�l�<�(���J�J�$�$�V�$�4�	��<�<�y�<�1���I���1�.��	�	�	�#������:�:�<�0r=c�r�[R"S5nURURS5S5 g)NzContent-Type: blarg; baz; boo
�bazr+�r��message_from_stringr3rKrps  r:�test_bad_param�TestMessageAPI.test_bad_param�s,���'�'�(I�J��������u�-�r�2r=c�t�[R"S5nUR5nURUS5 g)NziContent-Disposition: attachment; filename*="ignored"; filename*0*="utf-8''foo%20"; filename*1*="bar.txt"
zfoo bar.txt�r�rr�r3�r7r9�filenames   r:�$test_continuation_sorting_part_order�3TestMessageAPI.test_continuation_sorting_part_order�s7���'�'�
(�
���#�#�%������=�1r=c�t�[R"S5nUR5nURUS5 g)Nz6Content-Disposition: attachment; filename*="bar.txt"; zbar.txtrr s   r:�test_sorting_no_continuations�,TestMessageAPI.test_sorting_no_continuations�s7���'�'�
&�
���#�#�%������9�-r=c�p�[R"S5nURUR5S5 g�Nz
From: foo
�r�rr3r�rps  r:�test_missing_filename�$TestMessageAPI.test_missing_filename��+���'�'�
�6������)�)�+�T�2r=c�p�[R"S5nURUR5S5 g)Nz%Content-Disposition: blarg; filename
r+r)rps  r:�test_bogus_filename�"TestMessageAPI.test_bogus_filename�s.���'�'�0�2������)�)�+�R�0r=c�p�[R"S5nURUR5S5 gr(�r�rr3r�rps  r:�test_missing_boundary�$TestMessageAPI.test_missing_boundary�r,r=c�^�URn[R"S5nU"URSS9/SQ5 [R"S5nU"URSS9/SQ5 U"UR5S5 [R"S5nU"URSS9/SQ5 g)N�&X-Header: foo=one; bar=two; baz=three
�x-header�r�))r��one)�bar�two�r�threez X-Header: foo; bar=one; baz=two
))r�r+)r9r8)rr:�"X-Header: foo; bar="one"; baz=two
)r3r�r�
get_paramsr6s   r:�test_get_params�TestMessageAPI.test_get_params�s���
�
�
���'�'�5�7��
�3�>�>��>�,�=�	?��'�'�/�1��
�3�>�>��>�,�8�	:�
�3�>�>��T�"��'�'�1�3��
�3�>�>��>�,�8�	:r=c�d�[5nSUS'URURS5S5 g)Nz>Content-Type: Multipart/mixed; boundary = "CPIMSSMTPC06p5f3tG"rF�boundary�CPIMSSMTPC06p5f3tG)rr3rKrps  r:�test_get_param_liberal�%TestMessageAPI.test_get_param_liberal�s-���i��^��N��������z�2�4H�Ir=c��URn[R"S5nU"URSSS9S5 U"URSSS9S5 U"URS5S5 [R"S5nU"URSSS9S	5 U"URSSS9S
5 U"URSSS9S5 g)Nr5r9r6r7r:�quuzr=r�r+r8r�r3r�rrKr6s   r:�test_get_param�TestMessageAPI.test_get_param�s���
�
�
���'�'�5�7��
�3�=�=��z�=�2�E�:�
�3�=�=��
�=�3�T�:�
�3�=�=�� �$�'��'�'�1�3��
�3�=�=��z�=�2�B�7�
�3�=�=��z�=�2�E�:�
�3�=�=��z�=�2�E�:r=c��URS5nURURS5RS5S5 g)Nz
msg_22.txtr��namez
wibble.JPG)r4r3r_rKrps  r:�'test_get_param_funky_continuation_lines�6TestMessageAPI.test_get_param_funky_continuation_lines�s4���l�l�<�(���������+�5�5�f�=�|�Lr=c��[R"S5nURURS5S5 URURSSS9S5 g)Nz4Content-Type: image/pjpeg; name="Jim&amp;&amp;Jill"
rLzJim&amp;&amp;JillF��unquotez"Jim&amp;&amp;Jill"rrps  r:�#test_get_param_with_semis_in_quotes�2TestMessageAPI.test_get_param_with_semis_in_quotes�sP���'�'�C�E��������v�.�0C�D�������v�u��=�.�	0r=c���[R"S5nURURS5S5 [R"S5nURURS5S5 g)Nz5Content-Type: foo; bar*0="baz\"foobar"; bar*1="\"baz"r9zbaz"foobar"bazrrps  r:�test_get_param_with_quotes�)TestMessageAPI.test_get_param_with_quotes�s^���'�'�E�G��������u�-�/?�@��'�'�K�M��������u�-�/?�@r=c	���SnSH�up#URX#US9 US3US-
-U-n[RRU5nUR	[U5U5 UR	[[
U55S5 UR	USU5 SSS5 M� SSUS-
--n[RRU5nUR	XV/5 g!,(df   M�=f)Ni��)�r+r+)�foo=barrY)z FOO = bar    rY)r��r�N�;r�rzs=")�subTestr��message�_parseparamr3�len�set)r7r[r�rZ�src�res�	malformeds       r:� test_get_param_linear_complexity�/TestMessageAPI.test_get_param_linear_complexity�s���
��
�D�A�
����!��,���1�g��Q��'�!�+���m�m�/�/��4��� � ��S��1�-�� � ��S��X���2�� � ��Q���+�-�,�
��C�1�q�5�M�)�	��m�m�'�'�	�2������k�*�-�,�s�BC%�%
C4	c��[R"S5nURSU5 URSU5 URSU5 URSU5 g)NzHeader: existsr�r�HEADER�headerx)r�rr��assertNotInrps  r:�test_field_containment�%TestMessageAPI.test_field_containment�sM���'�'�(8�9���
�
�h��$��
�
�h��$��
�
�h��$�����C�(r=c��URn[5nURSS5 U"URS5S5 URSS5 U"URS5S5 U"URSSS9S5 U"UR	5/SQ5 U"UR	SS9/S	Q5 URSS
SS9 U"URSSS9S
5 g)
NrC�iso-2022-jp�
importance�
high valueFrP�"high value")�rAr+)rCrn)rorp)rr)rCz
"iso-2022-jp")rorqziso-9999-xxzX-Jimmyr7)r3r�	set_paramrKr>r6s   r:�test_set_param�TestMessageAPI.test_set_params���
�
�
���i���
�
�i��/�
�3�=�=��#�]�3��
�
�l�L�1�
�3�=�=��&��5�
�3�=�=��u�=�5�~�F�
�3�>�>��<�	=�	�3�>�>�%�>�(�+G�	H�	�
�
�i��y�
�A�
�3�=�=��9�=�5�}�Er=c�B�URnURS5nU"UR5/SQ5 URS5nUR	S5 U"UR5SS/5 URSU5 U"UR5SSSU4/5 g)N�
msg_05.txt)��multipart/reportr+)�report-type�delivery-status�rB�%D1690A7AC1.996856090/mail.example.comrzrxr|)r3r4r>rK�	del_paramrs)r7r8r9�old_vals    r:�test_del_param�TestMessageAPI.test_del_params���
�
�
���l�l�<�(��
�3�>�>��C�	D��-�-�
�.���
�
�m�$�
�3�>�>��$�A�C�	D�	�
�
�m�W�-�
�3�>�>��$�A�
�G�$�&�	'r=c��[5nURSSSS9 URSS5 URUSS5 g)N�Content-Disposition�
attachment�bud.gif�r!r!�content-disposition�r�
add_headerr~r3rps  r:�test_del_param_on_other_header�-TestMessageAPI.test_del_param_on_other_header"sA���i�����,�l�Y��O��
�
�j�"7�8�����2�3�\�Br=c�<�[5nURSS5 g)Nr!r�)rr~rps  r:�$test_del_param_on_nonexistent_header�3TestMessageAPI.test_del_param_on_nonexistent_header(s���i���
�
�j�"7�8r=c��[5nURSSSS9 USnURSSS9 URUSU5 g)NrFrAr[�rC�foobarr7r�)r7r9�existing_headers   r:�test_del_nonexistent_param�)TestMessageAPI.test_del_nonexistent_param-sJ���i�����~�|�W��E��n�-���
�
�h�~�
�6�����^�,�o�>r=c�"�URn[5nUR[URS5 UR	S5 U"USS5 URSS5 U"USS5 UR	S5 U"USS5 g)	Nr�rArBrCrQrRz	text/htmlztext/html; charset="us-ascii")r3rr��
ValueError�set_typersr6s   r:�
test_set_type�TestMessageAPI.test_set_type4s��
�
�
���i�����*�c�l�l�F�;����\�"�
�3�~���-��
�
�i��,�
�3�~�� @�A����[�!�
�3�~�� ?�@r=c�p�[5nSUS'URSS5 URUSS5 g)NrAzX-Content-Type�application/octet-streamzx-content-type)rr�r3rps  r:�test_set_type_on_other_header�,TestMessageAPI.test_set_type_on_other_header?s;���i�� ,�������/�1A�B�����-�.�0J�Kr=c�X�[5nURUR5S5 g)NrA)rr3rJrps  r:�test_get_content_type_missing�,TestMessageAPI.test_get_content_type_missingEs"���i������-�-�/��>r=c�z�[5nURS5 URUR5S5 g)N�message/rfc822)r�set_default_typer3rJrps  r:�/test_get_content_type_missing_with_default_type�>TestMessageAPI.test_get_content_type_missing_with_default_typeIs2���i�����-�.�����-�-�/�1A�Br=c��URS5nURURS5R5S5 g)N�
msg_30.txtrr��r4r3r_rJrps  r:�+test_get_content_type_from_message_implicit�:TestMessageAPI.test_get_content_type_from_message_implicitN�5���l�l�<�(���������+�<�<�>�)�	+r=c��URS5nURURS5R5S5 g)N�
msg_28.txtrr�r�rps  r:�+test_get_content_type_from_message_explicit�:TestMessageAPI.test_get_content_type_from_message_explicitSr�r=c�f�URS5nURUR5S5 g)Nr�rA�r4r3rJrps  r:�6test_get_content_type_from_message_text_plain_implicit�ETestMessageAPI.test_get_content_type_from_message_text_plain_implicitX�)���l�l�<�(������-�-�/��>r=c�f�URS5nURUR5S5 g)Nr�rAr�rps  r:�6test_get_content_type_from_message_text_plain_explicit�ETestMessageAPI.test_get_content_type_from_message_text_plain_explicit\r�r=c�X�[5nURUR5S5 g)Nr��rr3�get_content_maintyperps  r:�!test_get_content_maintype_missing�0TestMessageAPI.test_get_content_maintype_missing`s"���i������1�1�3�V�<r=c�z�[5nURS5 URUR5S5 g)Nr�r^)rr�r3r�rps  r:�3test_get_content_maintype_missing_with_default_type�BTestMessageAPI.test_get_content_maintype_missing_with_default_typeds1���i�����-�.�����1�1�3�Y�?r=c��URS5nURURS5R5S5 g)Nr�rr^�r4r3r_r�rps  r:�/test_get_content_maintype_from_message_implicit�>TestMessageAPI.test_get_content_maintype_from_message_impliciti�2���l�l�<�(���������+�@�@�B�I�Nr=c��URS5nURURS5R5S5 g)Nr�rr^r�rps  r:�/test_get_content_maintype_from_message_explicit�>TestMessageAPI.test_get_content_maintype_from_message_explicitmr�r=c�f�URS5nURUR5S5 g)Nr�r��r4r3r�rps  r:�:test_get_content_maintype_from_message_text_plain_implicit�ITestMessageAPI.test_get_content_maintype_from_message_text_plain_implicitq�)���l�l�<�(������1�1�3�V�<r=c�f�URS5nURUR5S5 g)Nr�r�r�rps  r:�:test_get_content_maintype_from_message_text_plain_explicit�ITestMessageAPI.test_get_content_maintype_from_message_text_plain_explicitur�r=c�X�[5nURUR5S5 g)N�plain�rr3�get_content_subtyperps  r:� test_get_content_subtype_missing�/TestMessageAPI.test_get_content_subtype_missingys"���i������0�0�2�G�<r=c�z�[5nURS5 URUR5S5 g)Nr��rfc822)rr�r3r�rps  r:�2test_get_content_subtype_missing_with_default_type�ATestMessageAPI.test_get_content_subtype_missing_with_default_type}s1���i�����-�.�����0�0�2�H�=r=c��URS5nURURS5R5S5 g)Nr�rr��r4r3r_r�rps  r:�.test_get_content_subtype_from_message_implicit�=TestMessageAPI.test_get_content_subtype_from_message_implicit��2���l�l�<�(���������+�?�?�A�8�Lr=c��URS5nURURS5R5S5 g)Nr�rr�r�rps  r:�.test_get_content_subtype_from_message_explicit�=TestMessageAPI.test_get_content_subtype_from_message_explicit�r�r=c�f�URS5nURUR5S5 g)Nr�r��r4r3r�rps  r:�9test_get_content_subtype_from_message_text_plain_implicit�HTestMessageAPI.test_get_content_subtype_from_message_text_plain_implicit��)���l�l�<�(������0�0�2�G�<r=c�f�URS5nURUR5S5 g)Nr�r�r�rps  r:�9test_get_content_subtype_from_message_text_plain_explicit�HTestMessageAPI.test_get_content_subtype_from_message_text_plain_explicit�r�r=c�b�[5nSUS'URUR5S5 g)N�no-slash-in-this-stringrFr�r�rps  r:�test_get_content_maintype_error�.TestMessageAPI.test_get_content_maintype_error�s,���i��7��N������1�1�3�V�<r=c�b�[5nSUS'URUR5S5 g)Nr�rFr�r�rps  r:�test_get_content_subtype_error�-TestMessageAPI.test_get_content_subtype_error�s,���i��7��N������0�0�2�G�<r=c�x�URn[5nURSS5 URSS5 URSS5 U"UR5/SQ5 U"UR	5/SQ5 URSS	5 U"UR5/SQ5 U"UR	5/S
Q5 URSS5 URSS5 U"UR5/S
Q5 U"UR	5/SQ5 UR
[UR
SS5 g)N�First�One�Second�Two�Third�Three)r�r�r�)r�r�r��Twenty)r�r�r��Eleven�One Hundred)r�r�r�r�)r�r�r�r��Fourth�Missing)r3rr��keys�values�replace_headerr��KeyErrorr6s   r:�test_replace_header�"TestMessageAPI.test_replace_header�s���
�
�
���i�����w��&����x��'����w��(�
�3�8�8�:�3�4�
�3�:�:�<�0�1����8�X�.�
�3�8�8�:�3�4�
�3�:�:�<�3�4����w��)����7�M�2�
�3�8�8�:�<�=�
�3�:�:�<�E�F����(�C�$6�$6��)�Lr=c��[5nURUR55 URSSSS9 UR	UR5S5 URSS5 UR	UR5S5 URSS5 UR	UR5S5 g)Nr�r�z
random.avir��inline�InlinE)r�assertIsNone�get_content_dispositionr�r3r�rps  r:�test_get_content_disposition�+TestMessageAPI.test_get_content_disposition�s����i�����#�5�5�7�8����,�l� ,�	�	.�����4�4�6��E����0�(�;�����4�4�6��A����0�(�;�����4�4�6��Ar=c���Sn[5nSUS'SUS'URU5 URURSS9S5 UR	UR
S	[R5 g)
NzAwDp0P7//y6LwKEAcPa/6Q=9zaudio/x-midirBr\rDTr]s����.���p���r)rrVr3r_�assertIsInstance�defectsr �InvalidBase64CharactersDefect�r7�xr9s   r:�test_broken_base64_payload�)TestMessageAPI.test_broken_base64_payload�ss��&���i��,��N��+3��'�(��������������5�7�	9�	
���c�k�k�!�n�$�B�B�	Dr=c��Sn[5nSUS'SUS'URU5 URURSS9[	US55 g)	Nuthis is a bröken thing to dorArBrfrDTr]zraw-unicode-escape)rrVr3r_rrs   r:�test_broken_unicode_payload�*TestMessageAPI.test_broken_unicode_payload�sW��
.���i��*��N��+1��'�(��������������5��q�"6�7�	9r=c��SRS5n[5nSUS'SUS'XlURUR	SS9U5 g)	Nu#this is a quéstionable thing to dor[�text/plain; charset="utf-8"rBrfrDTr])r�r�_payloadr3r_rs   r:�test_questionable_bytes_payload�.TestMessageAPI.test_questionable_bytes_payload�sP��
2�8�8��A���i��;��N��+1��'�(�����������5�q�9r=c�d�[5nURSSSS9 URSUS5 g)Nr�r�r�r�zattachment; filename="bud.gif"�rr�r3rps  r:�test_ascii_add_header�$TestMessageAPI.test_ascii_add_header�s<���i�����,�l� )�	�	+����9��%�&�	(r=c�d�[5nURSSSS9 URSUS5 g)Nr�r��Fußballer.pptr�z/attachment; filename*=utf-8''Fu%C3%9Fballer.pptrrps  r:�test_noascii_add_header�&TestMessageAPI.test_noascii_add_header�s<���i�����,�l�%�	�	'����?��%�&�	(r=c�d�[5nURSSSS9 URSUS5 g)Nr�r�)r?r+rr�z1attachment; filename*=iso-8859-1''Fu%DFballer.pptrrps  r:�#test_nonascii_add_header_via_triple�2TestMessageAPI.test_nonascii_add_header_via_triple�s<���i�����,�l�9�	�	;����A��%�&�	(r=c�d�[5nURSSSS9 URSUS5 g)Nr�r�zwindows [filename].pptr�z-attachment; filename="windows [filename].ppt"rrps  r:�#test_ascii_add_header_with_tspecial�2TestMessageAPI.test_ascii_add_header_with_tspecial�s<���i�����,�l�-�	�	/����;��%�&�	(r=c�d�[5nURSSSS9 URSUS5 g)Nr�r�uFußballer [filename].pptr�z@attachment; filename*=utf-8''Fu%C3%9Fballer%20%5Bfilename%5D.pptrrps  r:�&test_nonascii_add_header_with_tspecial�5TestMessageAPI.test_nonascii_add_header_with_tspecial�s<���i�����,�l�0�	�	2����N��%�&�	(r=c��SHNn[5nSU-US'SUS'URS5 URURSS9S	S
U-5 MP g)N��latin-1r��text/plain; charset=%srBrErDsfoo=e6=96=87barTr]�	foo文bar�1get_payload returns wrong result with charset %s.ro�r7rCr9s   r:�test_binary_quopri_payload�)TestMessageAPI.test_binary_quopri_payloadsb��+�G��)�C�":�W�"D�C���/A�C�+�,��O�O�.�/�������t��,�%�C�g�M�
O�,r=c��SHNn[5nSU-US'SUS'URS5 URURSS9S	S
U-5 MP g)Nr,r.rBr\rDsZm9v5paHYmFyTr]r/r0ror1s   r:�test_binary_base64_payload�)TestMessageAPI.test_binary_base64_payload
sa��+�G��)�C�":�W�"D�C���/7�C�+�,��O�O�O�,�������t��,�%�C�g�M�
O�,r=c
���SHknSHbn[5nSU-US'X#S'URS5 URURSS9S	[	S
5RX55 Md Mm g)Nr,r�r.rBrDs begin 666 -
)9F]OYI:'8F%R
 
end
Tr]r/)z!get_payload returns wrong result z"with charset {0} and encoding {1}.)rrVr3r_r��format)r7rCr�r9s    r:�test_binary_uuencode_payload�+TestMessageAPI.test_binary_uuencode_payloadsz��+�G�F���i��&>��&H��N�#�3;�/�0���� G�H�� � ��O�O�4�O�0�)��?�@���w�1�3�G�,r=c�d�[5nURSSSS9 URSUS5 g)Nr�r)�foo_barzinline; foo-barrrps  r:�$test_add_header_with_name_only_param�3TestMessageAPI.test_add_header_with_name_only_param&s3���i�����,�h���E����*�C�0E�,F�Gr=c�f�[5nURSS5 URSUS5 g)NzX-Statusr+rrps  r:�test_add_header_with_no_value�,TestMessageAPI.test_add_header_with_no_value+s+���i�����z�4�(�����S��_�-r=c��[5n[S5US'UR[RUR
5 g�Nzdummy
X-Injected-Header: test�Dummy)rrr�r r�r�rps  r:�(test_embedded_header_via_Header_rejected�7TestMessageAPI.test_embedded_header_via_Header_rejected2s2���i���>�?��G�����&�1�1�3�=�=�Ar=c�v�[5nSUS'UR[RUR5 grC)rr�r r�r�rps  r:�(test_embedded_header_via_string_rejected�7TestMessageAPI.test_embedded_header_via_string_rejected7s,���i��7��G�����&�1�1�3�=�=�Ar=c��[S5nSUS'UR[U5[R"S55 g)Nzabc
uÉ test�Subjectz�            Content-Type: text/plain; charset="us-ascii"
            MIME-Version: 1.0
            Content-Transfer-Encoding: 7bit
            Subject: =?utf-8?q?=C3=89_test?=

            abc
            �rr3r�r�r��r7rs  r:�-test_unicode_header_defaults_to_utf8_encoding�<TestMessageAPI.test_unicode_header_defaults_to_utf8_encoding<s9���W��� ��)������Q�����1�!�	r=c�x�[S5nUR[U5[R"S55 g)NuÉ testabc
z�            Content-Type: text/plain; charset="utf-8"
            MIME-Version: 1.0
            Content-Transfer-Encoding: base64

            w4kgdGVzdGFiYwo=
            rLrMs  r:�+test_unicode_body_defaults_to_utf8_encoding�:TestMessageAPI.test_unicode_body_defaults_to_utf8_encodingIs0���^�$������Q�����1�!�	r=c��[R"[R"S5[RR
S9nUR
URSS9S5 URUSR/5 g)NzP        Content-Transfer-Encoding: base64

        SGVsbG8uIFRlc3Rpbmc=
        r�Tr]�Hello. TestingrD�
r�rr�r�r��defaultr3r_�assertDefectsEqualrrps  r:�#test_string_payload_with_base64_cte�2TestMessageAPI.test_string_payload_with_base64_cteTsk���'�'����9�)
��\�\�)�)�	+��
	
��������5�7H�I�����$?� @� H� H�"�Mr=�N)_�__name__�
__module__�__qualname__�__firstlineno__r;rNrSrWrbrhrkrqryr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rr
r
rrrr"r%r*r.r2r?rDrIrMrRrUrerkrtr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrrr r#r&r)r2r5r9r=r@rErHrNrQrX�__static_attributes__rZr=r:r.r.9s���,�A�4B�H�:�=�=�0�
4�;�"	5�.�+�8�,C�
2�	2�@�,	1�9��
!�3�1�4�,
4�4�6�1�3�2�.�3�1�
3�:�"J�
;�$M�
0�A�+�*)�F�"'�"C�9�
?�	A�L�?�C�
+�
+�
?�?�=�@�
O�O�=�=�=�>�
M�M�=�=�=�
=�
M�"	B�
D�	9�:�(�(�(�(�(�	O�	O�3�H�
.�B�
B�
�	�Nr=r.c�8�\rSrSrSrSrSrSrSrSr	Sr
g	)
�TestEncodersi`c
�x�[SS5nUR5nSSS5 [RRRW5nUR
5nURS5nUR[UVs/sHn[U5PM sn5S5 g!,(df   N�=fs snf)N�
python.gif�rbr*�L)r'r�r��mime�imagerr_r��assertLessEqual�maxr`)r7r��bindata�mimed�base64edr�rs       r:�test_EncodersEncode_base64�'TestEncoders.test_EncodersEncode_base64bs���
�l�D�
)�R��g�g�i�G�*��
�
� � �*�*�7�3���$�$�&�����t�$�����S�5�!:�5�a�3�q�6�5�!:�;�R�@�
*�
)��";s�B&�B7�&
B4c�j�URn[5nURS5 U"USS5 g)NrQrD�7bit)r3rrIr6s   r:�test_encode_empty_payload�&TestEncoders.test_encode_empty_payloadks0��
�
�
���i�����
�#�
�3�*�+�V�4r=c��URn[S5nU"USS5 [S5nU"USS5 [SSS9nU"USS5 g)	N�hello worldrDrpuhello ø worldr\r?��_charsetrE)r3rr6s   r:�test_default_cte�TestEncoders.test_default_cteqs`��
�
�
���}�%��
�3�*�+�V�4��)�*��
�3�*�+�X�6��)�L�A��
�3�*�+�-?�@r=c��URn[SSS9nU"USS5 U"UR5[R"S55 g)Nu文
�euc-jprurDrpz�            MIME-Version: 1.0
            Content-Type: text/plain; charset="iso-2022-jp"
            Content-Transfer-Encoding: 7bit

            $BJ8(B
            )r3rr�r�r�r6s   r:�test_encode7or8bit�TestEncoders.test_encode7or8bit}sK���
�
���w��2��
�3�*�+�V�4�
�3�=�=�?�H�O�O�-��	r=c�|�[SSS5nUR[U5[R"S55 g)Nuáö
r�z
ISO-8859-1z�            MIME-Version: 1.0
            Content-Type: text/text; charset="iso-8859-1"
            Content-Transfer-Encoding: quoted-printable

            =E1=F6
            rLrps  r:�test_qp_encode_latin1�"TestEncoders.test_qp_encode_latin1�s4���|�V�\�:������S��8�?�?�4�$�	r=c�|�[SSS5nUR[U5[R"S55 g)Nuż
r�z
ISO-8859-2z�            MIME-Version: 1.0
            Content-Type: text/text; charset="iso-8859-2"
            Content-Transfer-Encoding: quoted-printable

            =BF
            rLrps  r:�test_qp_encode_non_latin1�&TestEncoders.test_qp_encode_non_latin1�s4���z�6�<�8������S��8�?�?�4�$�	r=rZN)r[r\r]r^rmrqrwr{r~r�r_rZr=r:rara`s"��A�5�
A�
��	r=rac��\rSrSrSrSrSrSrSrSr	Sr
S	rS
rSr
SrS
rSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSr Sr!S r"S!r#S"r$S#r%S$r&S%r'S&r(S'r)S(r*S)r+S*r,g)+�TestLongHeadersi�Nc���URn[R"S5n[5n[	U5nURU5 U"UR
5S5 g)Nz�Subject: bug demonstration
	12345678911234567892123456789312345678941234567895123456789612345678971234567898112345678911234567892123456789112345678911234567892123456789
	more text

test
)�ndiffAssertEqualr�rrrr�r��r7r8r9�sfpr�s     r:�test_split_long_continuation�,TestLongHeaders.test_split_long_continuation�sT��
�
"�
"���'�'�)����j���c�N��	�	�	�#��
�3�<�<�>��	r=c���URnSn[USS9nU"UR5S5 [URSS55nU"UR5S5 g)Nz�bug demonstration
	12345678911234567892123456789312345678941234567895123456789612345678971234567898112345678911234567892123456789112345678911234567892123456789
	more text�	��continuation_wsr,z�bug demonstration
 12345678911234567892123456789312345678941234567895123456789612345678971234567898112345678911234567892123456789112345678911234567892123456789
 more text)r�rr�r�r7r8�hstr�hs    r:�,test_another_long_almost_unsplittable_header�<TestLongHeaders.test_another_long_almost_unsplittable_header�sc��
�
"�
"����
�4��.��
�1�8�8�:��	�
�4�<�<��c�*�+��
�1�8�8�:��	r=c��URn[S5n[S5n[S5nSnSnSn[XRSS9nURXc5 URXt5 [	5n	X�S'[5n
[
U
5nURU	5 U"U
R5S	5 U"URS
S9S5 g)
Nr?r|r[�Die Mieter treten hier ein werden mit einem Foerderband komfortabel den Korridor entlang, an s�dl�ndischen Wandgem�lden vorbei, gegen die rotierenden Klingen bef�rdert. �;Finan�ni metropole se hroutily pod tlakem jejich d�vtipu.. ��正確に言うと翻訳はされていません。一部はドイツ語ですが、あとはでたらめです。実際には「Wenn ist das Nunstuck git und Slotermeyer? Ja! Beiherhund das Oder die Flipperwaldt gersput.」と言っています。rK��header_namea!Subject: =?iso-8859-1?q?Die_Mieter_treten_hier_ein_werden_mit_einem_Foerderb?=
 =?iso-8859-1?q?and_komfortabel_den_Korridor_entlang=2C_an_s=FCdl=FCndischen?=
 =?iso-8859-1?q?_Wandgem=E4lden_vorbei=2C_gegen_die_rotierenden_Klingen_bef?=
 =?iso-8859-1?q?=F6rdert=2E_?= =?iso-8859-2?q?Finan=E8ni_metropole_se_hrouti?=
 =?iso-8859-2?q?ly_pod_tlakem_jejich_d=F9vtipu=2E=2E_?= =?utf-8?b?5q2j56K6?=
 =?utf-8?b?44Gr6KiA44GG44Go57+76Kiz44Gv44GV44KM44Gm44GE44G+44Gb44KT44CC5LiA?=
 =?utf-8?b?6YOo44Gv44OJ44Kk44OE6Kqe44Gn44GZ44GM44CB44GC44Go44Gv44Gn44Gf44KJ?=
 =?utf-8?b?44KB44Gn44GZ44CC5a6f6Zqb44Gr44Gv44CMV2VubiBpc3QgZGFzIE51bnN0dWNr?=
 =?utf-8?b?IGdpdCB1bmQgU2xvdGVybWV5ZXI/IEphISBCZWloZXJodW5kIGRhcyBPZGVyIGRp?=
 =?utf-8?b?ZSBGbGlwcGVyd2FsZHQgZ2Vyc3B1dC7jgI3jgajoqIDjgaPjgabjgYTjgb7jgZk=?=
 =?utf-8?b?44CC?=

re��
maxlinelena	=?iso-8859-1?q?Die_Mieter_treten_hier_ein_werden_mit_einem_Foerde?=
 =?iso-8859-1?q?rband_komfortabel_den_Korridor_entlang=2C_an_s=FCdl=FCndis?=
 =?iso-8859-1?q?chen_Wandgem=E4lden_vorbei=2C_gegen_die_rotierenden_Klinge?=
 =?iso-8859-1?q?n_bef=F6rdert=2E_?= =?iso-8859-2?q?Finan=E8ni_metropole_se?=
 =?iso-8859-2?q?_hroutily_pod_tlakem_jejich_d=F9vtipu=2E=2E_?=
 =?utf-8?b?5q2j56K644Gr6KiA44GG44Go57+76Kiz44Gv44GV44KM44Gm44GE44G+44Gb?=
 =?utf-8?b?44KT44CC5LiA6YOo44Gv44OJ44Kk44OE6Kqe44Gn44GZ44GM44CB44GC44Go?=
 =?utf-8?b?44Gv44Gn44Gf44KJ44KB44Gn44GZ44CC5a6f6Zqb44Gr44Gv44CMV2VubiBp?=
 =?utf-8?b?c3QgZGFzIE51bnN0dWNrIGdpdCB1bmQgU2xvdGVybWV5ZXI/IEphISBCZWlo?=
 =?utf-8?b?ZXJodW5kIGRhcyBPZGVyIGRpZSBGbGlwcGVyd2FsZHQgZ2Vyc3B1dC7jgI0=?=
 =?utf-8?b?44Go6KiA44Gj44Gm44GE44G+44GZ44CC?=)
r�r
r�appendrrrr�r�r�)r7r8r��cz�utf8�g_head�cz_head�	utf8_headr�r9r�s           r:�test_long_nonstring�#TestLongHeaders.test_long_nonstring�s���
�
"�
"���L�!��
�\�
"���w���$��$��0�	�
�6�)�4��	�����	����!��i���I���j���c�N��	�	�	�#��
�3�<�<�>�
�
	�	�1�8�8�r�8�"�%1�	2r=c�^�URn[SSS9nU"UR5S5 g)N�iwasnipoop; giraffes="very-long-necked-animals"; spooge="yummy"; hippos="gargantuan"; marshmallows="gooey"�X-Foobar-Spoink-Defrobnitr��jwasnipoop; giraffes="very-long-necked-animals";
 spooge="yummy"; hippos="gargantuan"; marshmallows="gooey"�r�rr��r7r8r�s   r:�test_long_header_encode�'TestLongHeaders.test_long_header_encodes7��
�
"�
"���O�:�
<��	�1�8�8�:�>�	?r=c�`�URn[SSSS9nU"UR5S5 g)Nr�r�r��r�r�r�r�r�s   r:�<test_long_header_encode_with_tab_continuation_is_just_a_hint�LTestLongHeaders.test_long_header_encode_with_tab_continuation_is_just_a_hints:��
�
"�
"���O�:�#'�
)��	�1�8�8�:�>�	?r=c�`�URn[SSSS9nU"UR5S5 g)Nziwasnipoop; giraffes="very-long-necked-animals";	spooge="yummy"; hippos="gargantuan"; marshmallows="gooey"r�r�r�zjwasnipoop; giraffes="very-long-necked-animals";
	spooge="yummy"; hippos="gargantuan"; marshmallows="gooey"r�r�s   r:�-test_long_header_encode_with_tab_continuation�=TestLongHeaders.test_long_header_encode_with_tab_continuations;��
�
"�
"���O�:�#'�
)��	�1�8�8�:�?�	@r=c�\�[SS5nURUR5S5 g)N�文rz�=?iso-2022-jp?b?GyRCSjgbKEI=?=�rr3r��r7r�s  r:�0test_header_encode_with_different_output_charset�@TestLongHeaders.test_header_encode_with_different_output_charsets%���5�(�#���������%E�Fr=c�~�[SRS5S5nSnURUR5U5 g)Ns6test-ja ����Ƥ��줿�᡼��ϻʲ�Ԥξ�ǧ���ԤäƤ��ޤ�rzz�=?iso-2022-jp?b?dGVzdC1qYSAbJEIkWEVqOUYkNSRsJD8lYSE8JWskTztKMnE8VCROPjUbKEI=?=
 =?iso-2022-jp?b?GyRCRyckckJUJEMkRiQkJF4kORsoQg==?=)rr^r3r�)r7r�rcs   r:�5test_long_header_encode_with_different_output_charset�ETestLongHeaders.test_long_header_encode_with_different_output_charset#s?���$�%+�F�8�$4�h�
@��7��	
�������S�)r=c��URn[S5nSUS'[5n[U5nUR	U5 U"UR5S5 g)Nr+r�r�z�Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Foobar-Spoink-Defrobnit: wasnipoop; giraffes="very-long-necked-animals";
 spooge="yummy"; hippos="gargantuan"; marshmallows="gooey"

)r�rrrr�r�r�s     r:�test_header_splitter�$TestLongHeaders.test_header_splitter-sY��
�
"�
"���r�l��
H�	�'�(��j���c�N��	�	�	�#��
�3�<�<�>��	r=c�&�URn[5nSUS'[RS[	S555US'URS5 [
5n[U5nURU5 U"UR5S5 g)N�test@dom.ainr�c3�,# �UH
nSU-v� M g7f)z<%d@dom.ain>NrZ)�.0�is  r:�	<genexpr>�@TestLongHeaders.test_no_semis_header_splitter.<locals>.<genexpr>Es���&M�9�a�~��'9�9�s��
�
References�Testz�From: test@dom.ain
References: <0@dom.ain> <1@dom.ain> <2@dom.ain> <3@dom.ain> <4@dom.ain>
 <5@dom.ain> <6@dom.ain> <7@dom.ain> <8@dom.ain> <9@dom.ain>

Test)
r�r�SPACEr��rangerVrrr�r�r�s     r:�test_no_semis_header_splitter�-TestLongHeaders.test_no_semis_header_splitterAsv��
�
"�
"���i��$��F��!�J�J�&M�5��9�&M�M��L��������j���c�N��	�	�	�#��
�3�<�<�>��		r=c�`�URn[S5nU"UR5S5 g)Nz�Subject: the first part of this is short, but_the_second_part_does_not_fit_within_maxlinelen_and_thus_should_be_on_a_line_all_by_itselfz�Subject: the first part of this is short,
 but_the_second_part_does_not_fit_within_maxlinelen_and_thus_should_be_on_a_line_all_by_itselfr�r�s   r:�"test_last_split_chunk_does_not_fit�2TestLongHeaders.test_last_split_chunk_does_not_fitQ�5��
�
"�
"����
��	�1�8�8�:�b�	cr=c�`�URn[S5nU"UR5S5 g)Nz_, but_the_second_part_does_not_fit_within_maxlinelen_and_thus_should_be_on_a_line_all_by_itselfz`,
 but_the_second_part_does_not_fit_within_maxlinelen_and_thus_should_be_on_a_line_all_by_itselfr�r�s   r:�>test_splittable_leading_char_followed_by_overlong_unsplittable�NTestLongHeaders.test_splittable_leading_char_followed_by_overlong_unsplittableZr�r=c�`�URn[S5nU"UR5S5 g)Nza, , but_the_second_part_does_not_fit_within_maxlinelen_and_thus_should_be_on_a_line_all_by_itselfzb, ,
 but_the_second_part_does_not_fit_within_maxlinelen_and_thus_should_be_on_a_line_all_by_itselfr�r�s   r:�Gtest_multiple_splittable_leading_char_followed_by_overlong_unsplittable�WTestLongHeaders.test_multiple_splittable_leading_char_followed_by_overlong_unsplittablecr�r=c�`�URn[S5nU"UR5S5 g)NzTthis_part_does_not_fit_within_maxlinelen_and_thus_should_be_on_a_line_all_by_itself;r�r�s   r:�1test_trailing_splittable_on_overlong_unsplittable�ATestLongHeaders.test_trailing_splittable_on_overlong_unsplittablels1��
�
"�
"���*�
+��
�1�8�8�:�*�	+r=c�`�URn[S5nU"UR5S5 g)NzW; this_part_does_not_fit_within_maxlinelen_and_thus_should_be_on_a_line_all_by_itself; zX;
 this_part_does_not_fit_within_maxlinelen_and_thus_should_be_on_a_line_all_by_itself; r�r�s   r:�Itest_trailing_splittable_on_overlong_unsplittable_with_leading_splittable�YTestLongHeaders.test_trailing_splittable_on_overlong_unsplittable_with_leading_splittabless5��
�
"�
"���+�
,��	�1�8�8�:�Z�	[r=c�`�URn[S5nU"UR5S5 g)NzpThis is a long line that has two whitespaces  in a row.  This used to cause truncation of the header when foldedzqThis is a long line that has two whitespaces  in a row.  This used to cause
 truncation of the header when foldedr�r�s   r:�5test_long_header_with_multiple_sequential_split_chars�ETestLongHeaders.test_long_header_with_multiple_sequential_split_chars|s3��
�
"�
"���F�
G��
�1�8�8�:�)�	*r=c�`�URn[S5nU"UR5S5 g)N�Kthisverylongheaderhas;semicolons;and,commas,butthey;arenotlegal;fold,pointsr�r�s   r:�:test_splitter_split_on_punctuation_only_if_fws_with_header�JTestLongHeaders.test_splitter_split_on_punctuation_only_if_fws_with_header�s1��
�
"�
"���+�
,��
�1�8�8�:�2�	3r=c�`�URn[S5nU"UR5S5 g)Nz�this is a  test where we need to have more than one line before; our final line that is just too big to fit;; this_part_does_not_fit_within_maxlinelen_and_thus_should_be_on_a_line_all_by_itself;z�this is a  test where we need to have more than one line before;
 our final line that is just too big to fit;;
 this_part_does_not_fit_within_maxlinelen_and_thus_should_be_on_a_line_all_by_itself;r�r�s   r:�Dtest_leading_splittable_in_the_middle_just_before_overlong_last_part�TTestLongHeaders.test_leading_splittable_in_the_middle_just_before_overlong_last_part�s5��
�
"�
"���*�
+��	�1�8�8�:�Y�	Zr=c�`�URn[S5nU"UR5S5 g)NzTthis_part_does_not_fit_within_maxlinelen_and_thus_should_be_on_a_line_all_by_itself r�r�s   r:�/test_overlong_last_part_followed_by_split_point�?TestLongHeaders.test_overlong_last_part_followed_by_split_point�s1��
�
"�
"���*�
+��
�1�8�8�:�=�	>r=c�`�URn[S5nU"UR5S5 g)Nz�this_is_a__test_where_we_need_to_have_more_than_one_line_before_our_final_line_; ; this_part_does_not_fit_within_maxlinelen_and_thus_should_be_on_a_line_all_by_itself; z�this_is_a__test_where_we_need_to_have_more_than_one_line_before_our_final_line_;
 ;
 this_part_does_not_fit_within_maxlinelen_and_thus_should_be_on_a_line_all_by_itself; r�r�s   r:�@test_multiline_with_overlong_parts_separated_by_two_split_points�PTestLongHeaders.test_multiline_with_overlong_parts_separated_by_two_split_points��5��
�
"�
"���+�
,��	�1�8�8�:�Z�	[r=c�`�URn[S5nU"UR5S5 g)Nz�this is a test where we need to have more than one line before our final line; ; this_part_does_not_fit_within_maxlinelen_and_thus_should_be_on_a_line_all_by_itself; z�this is a test where we need to have more than one line before our final line;
 ;
 this_part_does_not_fit_within_maxlinelen_and_thus_should_be_on_a_line_all_by_itself; r�r�s   r:�>test_multiline_with_overlong_last_part_followed_by_split_point�NTestLongHeaders.test_multiline_with_overlong_last_part_followed_by_split_point�r�r=c��URn[5nSUS'[RS/S-5US'UR	S5 [5n[
U5nURU5 U"UR5S5 g)Nr�r�z<foo@dom.ain>  r�r�r�z�From: test@dom.ain
References: <foo@dom.ain>   <foo@dom.ain>   <foo@dom.ain>   <foo@dom.ain>
   <foo@dom.ain>   <foo@dom.ain>   <foo@dom.ain>   <foo@dom.ain>
   <foo@dom.ain>   <foo@dom.ain>  

Test�	r�rr�r�rVrrr�r�r�s     r:�%test_long_header_with_whitespace_runs�5TestLongHeaders.test_long_header_with_whitespace_runs�su��
�
"�
"���i��$��F��!�J�J�(9�':�R�'?�@��L��������j���c�N��	�	�	�#��
�3�<�<�>��		r=c��URn[5nSUS'[RS/S-5S-US'UR	S5 [5n[
U5nURU5 U"UR5S5 g)	Nr�r�z
<foo@dom.ain>r�z; abcr�r�z�From: test@dom.ain
References: <foo@dom.ain> <foo@dom.ain> <foo@dom.ain> <foo@dom.ain>
 <foo@dom.ain> <foo@dom.ain> <foo@dom.ain> <foo@dom.ain> <foo@dom.ain>
 <foo@dom.ain>; abc

Testr�r�s     r:�'test_long_run_with_semi_header_splitter�7TestLongHeaders.test_long_run_with_semi_header_splitter�sy��
�
"�
"���i��$��F��!�J�J��'8�2�'=�>��H��L��������j���c�N��	�	�	�#��
�3�<�<�>��		r=c���URn[5nSUS'SUS'URS5 [5n[	U5nURU5 U"UR
5S5 g)Nr�r�r�r�r�zrFrom: test@dom.ain
References: 
 thisverylongheaderhas;semicolons;and,commas,butthey;arenotlegal;fold,points

Test)r�rrVrrr�r�r�s     r:�.test_splitter_split_on_punctuation_only_if_fws�>TestLongHeaders.test_splitter_split_on_punctuation_only_if_fws�se��
�
"�
"���i��$��F��+��L��������j���c�N��	�	�	�#��
�3�<�<�>��		r=c��URnSn[U5nU"UR5S5 [S5nU"UR5S5 g)Nz\References: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxz]References:
 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx�Pxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxr�r�s    r:�test_no_split_long_header�)TestLongHeaders.test_no_split_long_header�sQ��
�
"�
"��(���4�L��	�1�8�8�:�U�	V�
�8���
�1�8�8�:�i�jr=c�b�URnSn[USS9nU"UR5S5 g)NaWfrom babylon.socal-raves.org (localhost [127.0.0.1]); by babylon.socal-raves.org (Postfix) with ESMTP id B570E51B81; for <mailman-admin@babylon.socal-raves.org>; Sat, 2 Feb 2002 17:00:06 -0800 (PST)
	from babylon.socal-raves.org (localhost [127.0.0.1]); by babylon.socal-raves.org (Postfix) with ESMTP id B570E51B81; for <mailman-admin@babylon.socal-raves.org>; Sat, 2 Feb 2002 17:00:06 -0800 (PST)
	from babylon.socal-raves.org (localhost [127.0.0.1]); by babylon.socal-raves.org (Postfix) with ESMTP id B570E51B81; for <mailman-admin@babylon.socal-raves.org>; Sat, 2 Feb 2002 17:00:06 -0800 (PST)
r�r�a_from babylon.socal-raves.org (localhost [127.0.0.1]);
 by babylon.socal-raves.org (Postfix) with ESMTP id B570E51B81;
 for <mailman-admin@babylon.socal-raves.org>;
 Sat, 2 Feb 2002 17:00:06 -0800 (PST)
	from babylon.socal-raves.org (localhost [127.0.0.1]);
 by babylon.socal-raves.org (Postfix) with ESMTP id B570E51B81;
 for <mailman-admin@babylon.socal-raves.org>;
 Sat, 2 Feb 2002 17:00:06 -0800 (PST)
	from babylon.socal-raves.org (localhost [127.0.0.1]);
 by babylon.socal-raves.org (Postfix) with ESMTP id B570E51B81;
 for <mailman-admin@babylon.socal-raves.org>;
 Sat, 2 Feb 2002 17:00:06 -0800 (PST)r�r�s    r:�"test_splitting_multiple_long_lines�2TestLongHeaders.test_splitting_multiple_long_lines�s7��
�
"�
"����

�4��.��
�1�8�8�:�)�	*r=c�f�URnSn[USSSS9nU"UR5S5 g)Nz�from modemcable093.139-201-24.que.mc.videotron.ca ([24.201.139.93] helo=cthulhu.gerg.ca)
	by kronos.mems-exchange.org with esmtp (Exim 4.05)
	id 17k4h5-00034i-00
	for test@mems-exchange.org; Wed, 28 Aug 2002 11:25:20 -0400�N�Receivedr�)r�r�r�z�from modemcable093.139-201-24.que.mc.videotron.ca ([24.201.139.93]
 helo=cthulhu.gerg.ca)
	by kronos.mems-exchange.org with esmtp (Exim 4.05)
	id 17k4h5-00034i-00
	for test@mems-exchange.org; Wed, 28 Aug 2002 11:25:20 -0400r�r�s    r:�&test_splitting_first_line_only_is_long�6TestLongHeaders.test_splitting_first_line_only_is_long	sA��
�
"�
"��A��

�4�B�J�#'�
)��
�1�8�8�:�A�	Br=c���URn[5n[SSSS9nURS5 U"UR	SS9S5 X2S'U"URSS	9S
5 U"URSS	9S5 g)
NzBritische Regierung gibtr?rKr�u-grünes Licht für Offshore-Windkraftprojekterer�zl=?iso-8859-1?q?Britische_Regierung_gibt_gr=FCnes_Licht_f=FCr_Offs?=
 =?iso-8859-1?q?hore-Windkraftprojekte?=��maxheaderlenzwSubject: =?iso-8859-1?q?Britische_Regierung_gibt_gr=FCnes_Licht_f=FCr_Offs?=
 =?iso-8859-1?q?hore-Windkraftprojekte?=

rzdSubject: =?iso-8859-1?q?Britische_Regierung_gibt_gr=FCnes_Licht_f=FCr_Offshore-Windkraftprojekte?=

)r�rrr�r�r�)r7r8r9r�s    r:�test_long_8bit_header�%TestLongHeaders.test_long_8bit_headers���
�
"�
"���i���-�|� )�
+��	���D�E�
�1�8�8�r�8�"�%,�	-��I��
�3�=�=�b�=�)�,�	�
	�3�=�=�a�=�(�+�	r=c���URn[5nSnX2S'U"URSS9S5 [5n[USS9US'U"URSS9S5 g)NuhBritische Regierung gibt grünes Licht für Offshore-Windkraftprojekte <a-very-long-address@example.com>zReply-Torr	z�Reply-To: =?utf-8?q?Britische_Regierung_gibt_gr=C3=BCnes_Licht_f=C3=BCr_Offs?=
 =?utf-8?q?hore-Windkraftprojekte_=3Ca-very-long-address=40example=2Ecom=3E?=

r�)r�rr�r)r7r8r9�
header_strings    r:� test_long_8bit_header_no_charset�0TestLongHeaders.test_long_8bit_header_no_charset-st��
�
"�
"���i��=�
�(�J��
�3�=�=�b�=�)�,�	�
�i�� ��-7�9��J��
�3�=�=�b�=�)�,�	r=c�h�URnSn[5nX#S'U"URSS9S5 g)Nz�"Someone Test #A" <someone@eecs.umich.edu>,<someone@eecs.umich.edu>, "Someone Test #B" <someone@umich.edu>, "Someone Test #C" <someone@eecs.umich.edu>, "Someone Test #D" <someone@eecs.umich.edu>r�rr	z�To: "Someone Test #A" <someone@eecs.umich.edu>,<someone@eecs.umich.edu>,
 "Someone Test #B" <someone@umich.edu>,
 "Someone Test #C" <someone@eecs.umich.edu>,
 "Someone Test #D" <someone@eecs.umich.edu>

)r�rr�)r7r8r�r9s    r:�test_long_to_header�#TestLongHeaders.test_long_to_headerBs>��
�
"�
"��;��
�i���D�	�
�3�=�=�b�=�)�,�	r=c��URnSn[U5nURS5 U"URSS9S5 g)NzIThis is an example of string which has almost the limit of header length.zAdd another line.rer�z\This is an example of string which has almost the limit of header length.
 Add another line.�r�rr�r��r7r8r�r�s    r:�test_long_line_after_append�+TestLongHeaders.test_long_line_after_appendSsB��
�
"�
"��W���1�I��	���$�%�
�1�8�8�r�8�"�%�	r=c��URnSn[U5nURS5 U"UR5S5 g)NzThis is a shorter line.z!Add another sentence. (Surprise?)z9This is a shorter line. Add another sentence. (Surprise?)rrs    r:�test_shorter_line_with_append�-TestLongHeaders.test_shorter_line_with_append\s<��
�
"�
"��%���1�I��	���4�5�
�1�8�8�:�F�	Hr=c�f�URnSnSn[USUS9nU"URSS9S5 g)Nz!X-Very-Very-Very-Long-Header-Nameu�Die Mieter treten hier ein werden mit einem Foerderband komfortabel den Korridor entlang, an südlündischen Wandgemälden vorbei, gegen die rotierenden Klingen befördert. r?r�rer�a=?iso-8859-1?q?Die_Mieter_treten_hier_e?=
 =?iso-8859-1?q?in_werden_mit_einem_Foerderband_komfortabel_den_Korridor_e?=
 =?iso-8859-1?q?ntlang=2C_an_s=FCdl=FCndischen_Wandgem=E4lden_vorbei=2C_ge?=
 =?iso-8859-1?q?gen_die_rotierenden_Klingen_bef=F6rdert=2E_?=r�)r7r8�fn�gsr�s     r:�test_long_field_name�$TestLongHeaders.test_long_field_namedsE��
�
"�
"��
0����
�2�|��4��
�1�8�8�r�8�"�%A�	Br=c�|�Sn[5n[USS9US'XS'URURSS9S5 g)	Nz�from FOO.TLD (vizworld.acl.foo.tld [123.452.678.9]) by hrothgar.la.mastaler.com (tmda-ofmipd) with ESMTP; Wed, 05 Mar 2003 18:10:18 -0700r�r��
Received-1�
Received-2rr	a1Received-1: from FOO.TLD (vizworld.acl.foo.tld [123.452.678.9]) by
 hrothgar.la.mastaler.com (tmda-ofmipd) with ESMTP;
 Wed, 05 Mar 2003 18:10:18 -0700
Received-2: from FOO.TLD (vizworld.acl.foo.tld [123.452.678.9]) by
 hrothgar.la.mastaler.com (tmda-ofmipd) with ESMTP;
 Wed, 05 Mar 2003 18:10:18 -0700

�rrr�r��r7r�r9s   r:�test_long_received_header�)TestLongHeaders.test_long_received_headerssK��/���i��"�1�d�;��L���L�����c�m�m��m�<�?�	r=c�~�Sn[5n[USSS9US'XS'URURSS9S5 g)	Nz�<15975.17901.207240.414604@sgigritzmann1.mathematik.tu-muenchen.de> (David Bremner's message of "Thu, 6 Mar 2003 13:58:21 +0100")r"r�r�r#rr	a#Received-1: 
 <15975.17901.207240.414604@sgigritzmann1.mathematik.tu-muenchen.de> (David
 Bremner's message of "Thu, 6 Mar 2003 13:58:21 +0100")
Received-2: 
 <15975.17901.207240.414604@sgigritzmann1.mathematik.tu-muenchen.de> (David
 Bremner's message of "Thu, 6 Mar 2003 13:58:21 +0100")

r$r%s   r:�test_string_headerinst_eq�)TestLongHeaders.test_string_headerinst_eq�sP��1���i��"�1�,�37�9��L���L�����c�m�m��m�<�?�	r=c��URn[5nSnX2S'[USS9US'SU-US'U"URSS9S	5 g)
Nz�iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAGFBMVEUAAAAkHiJeRUIcGBi9
 locQDQ4zJykFBAXJfWDjAAACYUlEQVR4nF2TQY/jIAyFc6lydlG5x8Nyp1Y69wj1PN2I5gzpzFace-1zFace-2r�r,zFace-3rr	a�Face-1: 
 iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAGFBMVEUAAAAkHiJeRUIcGBi9
 locQDQ4zJykFBAXJfWDjAAACYUlEQVR4nF2TQY/jIAyFc6lydlG5x8Nyp1Y69wj1PN2I5gzp
Face-2: 
 iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAGFBMVEUAAAAkHiJeRUIcGBi9
 locQDQ4zJykFBAXJfWDjAAACYUlEQVR4nF2TQY/jIAyFc6lydlG5x8Nyp1Y69wj1PN2I5gzp
Face-3: 
 iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAGFBMVEUAAAAkHiJeRUIcGBi9
 locQDQ4zJykFBAXJfWDjAAACYUlEQVR4nF2TQY/jIAyFc6lydlG5x8Nyp1Y69wj1PN2I5gzp

�r�rrr�)r7r8r9�ts    r:�-test_long_unbreakable_lines_with_continuation�=TestLongHeaders.test_long_unbreakable_lines_with_continuation�s^��
�
"�
"���i��
M���H�
��q�h�7��H�
��a���H�
�	�3�=�=�b�=�)�,�	r=c�x�URnSn[R"U5nU"URSS9S5 g)Nz�Received: from siimage.com ([172.25.1.3]) by zima.siliconimage.com with Microsoft SMTPSVC(5.0.2195.4905); Wed, 16 Oct 2002 07:41:11 -0700rr	z�Received: from siimage.com ([172.25.1.3]) by zima.siliconimage.com with
 Microsoft SMTPSVC(5.0.2195.4905); Wed, 16 Oct 2002 07:41:11 -0700

)r�r�rr��r7r8rr9s    r:�"test_another_long_multiline_header�2TestLongHeaders.test_another_long_multiline_header�s@��
�
"�
"��/���'�'��*��
�3�=�=�b�=�)�,�	r=c��URnSn[5nX#S'[USS9US'U"URSS9S5 g)Nz�List-Unsubscribe: <http://lists.sourceforge.net/lists/listinfo/spamassassin-talk>,        <mailto:spamassassin-talk-request@lists.sourceforge.net?subject=unsubscribe>�Listr�rr	a_List: List-Unsubscribe:
 <http://lists.sourceforge.net/lists/listinfo/spamassassin-talk>,
        <mailto:spamassassin-talk-request@lists.sourceforge.net?subject=unsubscribe>
List: List-Unsubscribe:
 <http://lists.sourceforge.net/lists/listinfo/spamassassin-talk>,
        <mailto:spamassassin-talk-request@lists.sourceforge.net?subject=unsubscribe>

r,)r7r8r�r9s    r:�%test_long_lines_with_different_header�5TestLongHeaders.test_long_lines_with_different_header�sN��
�
"�
"��%���i���F���Q�F�3��F��
�3�=�=�b�=�)�,�	r=c��[[R"S5SSS9nURUR	5S-[R"S5S-5 g)Nz�            We're going to pretend this header is in a non-ascii character set
            	to see if line wrapping with encoded words and embedded
               folding white space worksr[r�)rCr�r*z�            =?utf-8?q?We=27re_going_to_pretend_this_header_is_in_a_non-ascii_chara?=
             =?utf-8?q?cter_set?=
             =?utf-8?q?_to_see_if_line_wrapping_with_encoded_words_and_embedded?=
             =?utf-8?q?_folding_white_space_works?=)rr�r�r3r�r�s  r:�*test_long_rfc2047_header_with_embedded_fws�:TestLongHeaders.test_long_rfc2047_header_with_embedded_fws�sZ���8�?�?�$,�-�#�%�
'��	
�������D��(�/�/�;7�+8�9=�	+=�	>r=rZ)-r[r\r]r^�maxDiffr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrrrrr&r)r.r2r6r9r_rZr=r:r�r��s����G��(�"42�l?�?�@�G�*��(	� c�c�c�+�[�*�3�	Z�>�	[�	[�	�"	�"	�$
k�*�,B� �(�*�"�H�
B��$�&�0��&>r=r�c�8�\rSrSrSrSrSrSrSrSr	Sr
g	)
�TestFromManglingi�c�v�[5UlSURS'URRS5 g)Nzaaa@bbb.orgr�z(From the desk of A.A.A.:
Blah blah blah
)rr9rV�r7s r:�setUp�TestFromMangling.setUp�s0���9���(������������	r=c��[5n[USS9nURUR5 UR	UR5S5 g)NT��mangle_from_z<From: aaa@bbb.org

>From the desk of A.A.A.:
Blah blah blah
�rrr�r9r3r��r7r�r�s   r:�test_mangled_from�"TestFromMangling.test_mangled_from�s@���J���a�d�+��	�	�	�$�(�(���������(�	r=c��[5n[USS9nURUR5 UR	UR5S5 g)NFrCz;From: aaa@bbb.org

From the desk of A.A.A.:
Blah blah blah
rErFs   r:�test_dont_mangle_from�&TestFromMangling.test_dont_mangle_from�s@���J���a�e�,��	�	�	�$�(�(���������(�	r=c
�n�[5n[USS9n[R"[R
"S55nUR
U5 UR[UR5RS5Vs/sHnURS5(dMSPM sn5S5 gs snf)NTrCa)            From: foo@bar.com
            Mime-Version: 1.0
            Content-Type: multipart/mixed; boundary=XXX

            From somewhere unknown

            --XXX
            Content-Type: text/plain

            foo

            --XXX--

            From somewhere unknowable
            r*z>From r�r�)rrr�rr�r�r�r3r`r�r��
startswith)r7r�r�r9rs     r:�'test_mangle_from_in_preamble_and_epilog�8TestFromMangling.test_mangle_from_in_preamble_and_epilog�s����J���a�d�+���'�'����9�)��� 	
�	�	�#����������);�);�D�)A�=�)A�A�%&�\�\�(�%;� �)A�=�>�?@�	B��=s�B2�B2c��[R"S5RS5n[R"US-5n[5n[
USS9nURU5 URUR5US-5 g)Nz�            Content-Type: text/plain; charset="utf-8"
            MIME-Version: 1.0
            Content-Transfer-Encoding: 8bit
            From: aaa@bbb.org

        r[sFrom Rölli
TrCs
>From Rölli
)
r�r�r�r�rrr
r�r3r�)r7rr9�br�s     r:� test_mangled_from_with_bad_bytes�1TestFromMangling.test_mangled_from_with_bad_bytessu�����"�
��V�G�_�
	��&�&�v�0F�'F�G���I���1�4�0��	�	�	�#���������v�0G�'G�Hr=c�z�[R"S5RS5n[R"U5ng)Nu�            From: aperson@example.com
            Content-Type: multipart/mixed; boundary="1"
            Content-Transfer-Encoding: È
        r[)r�r�r�r�r)r7rr9s   r:�$test_multipart_with_bad_bytes_in_cte�5TestFromMangling.test_multipart_with_bad_bytes_in_cte$s5�����"�
��V�G�_�		�
�&�&�v�.�r=)r9N)r[r\r]r^r@rGrJrNrRrUr_rZr=r:r=r=�s"���	�	�B�.I�/r=r=c�2�\rSrSrSrSrSrSrSrSr	g)	�
TestMIMEAudioi/c��[SU3S5nUR5UlSSS5 [UR5Ulg!,(df   N)=f)Nzsndhdr.rd)r'r��
_audiodatar�_au�r7�extr�s   r:�_make_audio�TestMIMEAudio._make_audio0s?��
���u�o�t�
,�� �g�g�i�D�O�-��T�_�_�-���-�
,���A	�	
Ac���SSSSS.R5HJupURU5 UcUOUnURURR	5SU35 ML g)Nzx-aiffzx-wav�basic)�aifc�aiff�wav�auzaudio/)r�r^r3r[rJ�r7r]�subtypes   r:�test_guess_minor_type�#TestMIMEAudio.test_guess_minor_type5si������	
�
�%�'��L�C�
���S�!�$�_�c�'�G����T�X�X�6�6�8�F�7�)�:L�M�r=c���URS5 URR5nUR[R
"[
US55UR5 g)Nrfr�)r^r[r_r3r\�decodebytesrrZ�r7�payloads  r:�
test_encoding�TestMIMEAudio.test_encoding@sK��������(�(�&�&�(������+�+�E�'�7�,C�D����	*r=c��URS5 [URS5nURUR	5S5 g)Nrf�fishz
audio/fish)r^rrZr3rJ)r7rfs  r:�test_checkSetMinor� TestMIMEAudio.test_checkSetMinorFs9�������
�t����
/������,�,�.��=r=c�p�URS5 URnURRSSSS9 U"URSS5 U"URR	SS9S	S
/5 U"URRSSS9S5 /nU"URRSSS9S5 UR
URRS
USS9U5 UR
URRSU5U5 UR
URRSUSS9U5 g)Nrfr�r��	sndhdr.aur�r�z attachment; filename="sndhdr.au"r7�r�r+)r!rvr!r+r���failobjr�r�)r^r3r[r�r>rK�assertIs�r7r8�missings   r:�test_add_header�TestMIMEAudio.test_add_headerKs8�������
�
�
�������1�<�%0�	�	2�
�4�8�8�)�*�-�	/�
�4�8�8���&;��<�� 9�:�	<�
�4�8�8���j�1F��G��	���
�4�8�8���l�3H��I�2�N��
�
�d�h�h�(�(��7�(�)�*�+2�	4�	
�
�
�d�h�h�(�(��7�;�W�E��
�
�d�h�h�(�(��w�08�)�:�;B�	Dr=)r[rZN)
r[r\r]r^r^rirorsr}r_rZr=r:rXrX/s��.�
	N�*�>�
Dr=rXc�2�\rSrSrSrSrSrSrSrSr	g)	�
TestMIMEImageicc��[SU3S5nUR5UlSSS5 [UR5Ulg!,(df   N)=f)Nzpython.rd)r'r��_imgdatar�_imr\s   r:�_make_image�TestMIMEImage._make_imageds?��
���u�o�t�
,���G�G�I�D�M�-��T�]�]�+���-�
,�r`c���SSSSSSSSSSSSSS.
R5HJupURU5 UcUOUnURURR	5SU35 ML g)N�jpeg�rast�rgb)
�bmp�exr�gif�jpg�pbm�pgm�png�ppm�ras�sgi�tiff�webp�xbmzimage/)r�r�r3r�rJrgs   r:ri�#TestMIMEImage.test_guess_minor_typeis����������������
��%�'��L�C�
���S�!�$�_�c�'�G����T�X�X�6�6�8�F�7�)�:L�M�#r=c���URS5 URR5nUR[R
"[
US55UR5 g)Nr�r�)r�r�r_r3r\rlrr�rms  r:ro�TestMIMEImage.test_encoding}sK��������(�(�&�&�(������+�+�E�'�7�,C�D����	(r=c��URS5 [URS5nURUR	5S5 g)Nr�rrz
image/fish)r�rr�r3rJ)r7�ims  r:rs� TestMIMEImage.test_checkSetMinor�s9�������
�t�}�}�f�
-������,�,�.��=r=c�p�URS5 URnURRSSSS9 U"URSS5 U"URR	SS9S	S
/5 U"URRSSS9S5 /nU"URRSSS9S5 UR
URRS
USS9U5 UR
URRSU5U5 UR
URRSUSS9U5 g)Nr�r�r�r�r�r�z%attachment; filename="dingusfish.gif"r7rw)r!r�r!r+r�rxr�)r�r3r�r�r>rKrzr{s   r:r}�TestMIMEImage.test_add_header�s:�������
�
�
�������1�<�%5�	�	7�
�4�8�8�)�*�2�	4�
�4�8�8���&;��<�� >�?�	A�
�4�8�8���j�1F��G��	���
�4�8�8���l�3H��I�2�N��
�
�d�h�h�(�(���0E�)�G�HO�	Q�	
�
�
�d�h�h�(�(��7�;�W�E��
�
�d�h�h�(�(��w�08�)�:�;B�	Dr=)r�r�N)
r[r\r]r^r�rirorsr}r_rZr=r:r�r�cs��,�
N�((�>�
Dr=r�c�>�\rSrSrSrSrSrSrSrSr	Sr
S	rg
)�TestMIMEApplicationi�c�x�URn[S5nU"UR5S5 U"USS5 g)N�������r�rDr\)r3rrJr6s   r:�test_headers� TestMIMEApplication.test_headers�s<��
�
�
���9�:��
�3���!�#=�>�
�3�*�+�X�6r=c��URnSn[U5nU"UR5R5S5 U"URSS9U5 g)Nr�z+vv8/f7/Tr])r3rr_�strip)r7r8�	bytesdatar9s    r:�	test_body�TestMIMEApplication.test_body�sK��
�
�
��/�	��i�(��
�3�?�?��"�"�$�j�1�
�3�?�?�$�?�'��3r=c�P�Sn[U[RS9nURUR	5S[U5-5 URUR	SS9U5 URUSS5 [
5n[U5nURU5 UR5n[R"U5nURUR	5S[U5-5 URUR	SS9U5 URUSS5 g)Nr���_encoder��Tr]rGrf)rr�encode_7or8bitr3r_r`rr
r�r�r�r�r7r�r9r�r��wireform�msg2s       r:�$test_binary_body_with_encode_7or8bit�8TestMIMEApplication.test_binary_body_with_encode_7or8bit�s���/�	��i�(�2I�2I�J��������*�H�s�9�~�,E�F���������5�y�A�����8�9�6�B��I���1���	�	�	�#���:�:�<���'�'��1��������*�H�s�9�~�,E�F�����)�)��)�6�	�B�����9�:�F�Cr=c��Sn[U[RS9nURUR	5S[U5-5 URUR	SS9U5 [
5n[U5nURU5 UR5n[R"U5nURUR	5S[U5-5 URUR	SS9U5 g)Nr�r�r�Tr])rr�encode_noopr3r_r`rr
r�r�r�rr�s       r:�!test_binary_body_with_encode_noop�5TestMIMEApplication.test_binary_body_with_encode_noop�s���0�	��i�(�2F�2F�G��������*�H�s�9�~�,E�F���������5�y�A��I���1���	�	�	�#���:�:�<���'�'��1��������*�H�s�9�~�,E�F�����)�)��)�6�	�Br=c�L�Sn[U[RS9nURUR	SS9U5 [5n[
U5nURU5 UR5n[R"U5nURUR	SS9U5 g)Ns������r�Tr])rrr�r3r_rr
r�r�r�rr�s       r:�0test_binary_body_with_unicode_linend_encode_noop�DTestMIMEApplication.test_binary_body_with_unicode_linend_encode_noop�s���3�	��i�(�2F�2F�G����������5�y�A��I���1���	�	�	�#���:�:�<���'�'��1������)�)��)�6�	�Br=c� �Sn[U[RS9nURUR	5S5 URUR	SS9U5 URUSS5 [5n[
U5nURU5 UR5n[R"U5nURUR	5S5 URUR	SS9U5 URUSS5 g)Ns������ r�z=FA=FB=FC=FD=FE=FF=20Tr]rGrE)rr�
encode_quoprir3r_rr
r�r�r�rr�s       r:�#test_binary_body_with_encode_quopri�7TestMIMEApplication.test_binary_body_with_encode_quopri�s���0�	��i�(�2H�2H�I��������*�,C�D���������5�y�A�����8�9�;M�N��I���1���	�	�	�#���:�:�<���'�'��1��������*�,C�D�����)�)��)�6�	�B�����9�:�<N�Or=c���Sn[U[RS9nURUR	5S5 URUR	SS9U5 [5n[
U5nURU5 UR5n[R"U5nURUR	5S5 URUR	SS9U5 g)Nr�r�z	+vv8/f7/
Tr])rr�
encode_base64r3r_rr
r�r�r�rr�s       r:�#test_binary_body_with_encode_base64�7TestMIMEApplication.test_binary_body_with_encode_base64�s���/�	��i�(�2H�2H�I��������*�L�9���������5�y�A��I���1���	�	�	�#���:�:�<���'�'��1��������*�L�9�����)�)��)�6�	�Br=rZN)r[r\r]r^r�r�r�r�r�r�r�r_rZr=r:r�r��s*��7�4�D�"C�"
C�P� Cr=r�c�n�\rSrSrSrSrSrSrSrSr	Sr
\R"S	5S
5r
Srg)
�TestMIMETexti�c�$�[S5Ulg�N�hello there)r�_msgr?s r:r@�TestMIMEText.setUp�s���]�+��	r=c�T�URnU"URR5S5 U"URRS5S5 /nUR	URRSU5U5 UR	URRSUSS9U5 g)NrArCrQr�r7)r3r�rJrKrzr{s   r:�
test_types�TestMIMEText.test_types�s���
�
�
��
�4�9�9�%�%�'��6�
�4�9�9���y�)�:�6����
�
�d�i�i�)�)�(�G�<�g�F��
�
�d�i�i�)�)�)�W�X�)�N��	r=c��URURR5S5 URURR	55 gr�)r3r�r_�assertFalse�is_multipartr?s r:�test_payload�TestMIMEText.test_payloads:��������.�.�0�-�@�������/�/�1�2r=c�J�URn[SSS9nU"UR5RS5 U"USS5 [	S5nSUl[SUS9nU"UR5RS5 U"USS5 U"UR
5S5 g)Nr�rQrurBrRr[r)r3rrHrLr
rgr_rMs    r:�test_charset�TestMIMEText.test_charsets���
�
�
���}�z�:��
�3�?�?��*�*�J�7�
�3�~�� @�A��'�"�� $����}�w�7��
�3�?�?��*�*�G�4�
�3�~�� =�>�
�3�?�?��m�,r=c��URn[SSS9nU"UR5RS5 U"USS5 g)Nr�rQrurBrR)r3rrHrLr6s   r:�test_7bit_input�TestMIMEText.test_7bit_inputs@��
�
�
���}�z�:��
�3�?�?��*�*�J�7�
�3�~�� @�Ar=c��URn[S5nU"UR5S5 U"USS5 URSUR	55 g)Nr�rQrBrR)r3rrHr�r�r6s   r:�test_7bit_input_no_charset�'TestMIMEText.test_7bit_input_no_charsetsL��
�
�
���}�%��
�3�?�?��j�)�
�3�~�� @�A��
�
�m�S�]�]�_�5r=c���SnURn[USS9nU"UR5RS5 U"USS5 U"UR	SS9URS55 g)N�кирилицаr[rurBrTr])r3rrH�output_charsetr_r�)r7�teststrr8r9s    r:�test_utf8_input�TestMIMEText.test_utf8_input%sc��D��
�
�
���w��1��
�3�?�?��+�+�W�5�
�3�~�� =�>�
�3�?�?�$�?�'�����)@�Ar=zBcan't fix because of backward compat in email5, will fix in email6c�>�SnUR[[U5 g)Nr�)r��UnicodeEncodeErrorr)r7r�s  r:�test_utf8_input_no_charset�'TestMIMEText.test_utf8_input_no_charset-s��E�����,�h��@r=)r�N)r[r\r]r^r@r�r�r�r�r�r��unittest�skipr�r_rZr=r:r�r��sK��,��3�-�B�6�B��]�]���A��Ar=r�c��\rSrSrSrSrSrSrSrSr	Sr
S	rS
rSr
SrS
rSrSrSrSrSrSrSrSrSrg)�
TestMultiparti6c�h�[SS5nUR5nSSS5 [SSSS9n[WSS9nUR	S	S
SS9 [S5nUR
U5 UR
U5 S
US'SUS'SUS'Sn[R"U5nUSS:Xa[RnO[RnUS:�aSn	OSn	SX�S-4-n
[R"S[R"U55U
-US'X0lX@l
XPlg!,(df   GN=f)Nrcrd�	multipart�mixedr��rBr�)rLr�r�r�z$Hi there,

This is the dingus fish.
zBarry <barry@digicool.com>r�z)Dingus Lovers <cravindogs@cravindogs.com>r�zHere is your dingus fishrKg�4F�cp�A���r�-�+z %s%04d�$z%a, %d %b %Y %H:%M:%S�Date)r'r�rrr�rrw�time�	localtime�timezone�altzone�strftimer�r��_txt)r7r�ra�	containerrg�intro�now�	timetuple�tzsecs�sign�tzoffsets           r:r@�TestMultipart.setUp7s6��
�l�D�
)�R��7�7�9�D�*��[�'�J�G�	��$�%5�6��
���.��"2�	�	4�����
	����������8�	�&��E�	�$��9�	�)�� ���N�N�3�'�	��R�=�A���]�]�F��\�\�F��A�:��D��D���r�k�2�2�� �M�M�#��N�N�3��!�#+�,�	�&���	����	�C*�
)�s�D"�"
D1c��URnURnURnURUR	55 U"UR5S5 U"[
UR55S5 U"[URS5 URS5nURS5nURX@R5 URXPR5 U"UR5XE/5 URUR	55 URUR	55 g)Nrtr�rr�)
r3r�r��
assertTruer�rJr`r_�
IndexErrorrzr�r�r�)r7r8�raisesr�m0�m1s      r:�test_hierarchy�TestMultipart.test_hierarchy[s���
�
�
���"�"���I�I��������(�)�
�1����!2�3�
�3�q�}�}����#��z�1�=�=�!�,�
�]�]�1�
��
�]�]�1�
���
�
�b�)�)�$��
�
�b�(�(�#�
�1�=�=�?�R�H�%�������*�+�������*�+r=c�x�Sn[5RU5nURXR55 g)Nz�Content-Type: multipart/mixed; boundary="BOUNDARY"
MIME-Version: 1.0
Subject: A subject
To: aperson@dom.ain
From: bperson@dom.ain


--BOUNDARY


--BOUNDARY--
)rr�r�r�)r7r�r9s   r:�test_empty_multipart_idempotent�-TestMultipart.test_empty_multipart_idempotentms1�����h����%�����d�M�M�O�4r=c��[SS5nSUS'SUS'SUS'URS	5 URUR5S
5 g)Nr�r��	A subjectrK�aperson@dom.ainr��bperson@dom.ainr�r�z�Content-Type: multipart/mixed; boundary="BOUNDARY"
MIME-Version: 1.0
Subject: A subject
To: aperson@dom.ain
From: bperson@dom.ain

--BOUNDARY

--BOUNDARY--
)rr�r�r��r7�outers  r:�/test_no_parts_in_a_multipart_with_none_epilogue�=TestMultipart.test_no_parts_in_a_multipart_with_none_epilogue~sT����g�.��&��i��'��d��)��f�
�
���:�&����e�o�o�/�
2�
	r=c��[SS5nSUS'SUS'SUS'S	UlS	UlURS
5 UR	UR5S5 g)Nr�r�rrKr
r�rr�r+r�z�Content-Type: multipart/mixed; boundary="BOUNDARY"
MIME-Version: 1.0
Subject: A subject
To: aperson@dom.ain
From: bperson@dom.ain


--BOUNDARY

--BOUNDARY--
)r�preamble�epiloguer�r�r�rs  r:�0test_no_parts_in_a_multipart_with_empty_epilogue�>TestMultipart.test_no_parts_in_a_multipart_with_empty_epilogue�sb����g�.��&��i��'��d��)��f�
�������
���:�&����e�o�o�/�2�	r=c���URn[SS5nSUS'SUS'SUS'URS	5 [S
5nUR	U5 U"UR5S5 g)Nr�r�rrKr
r�rr�r�rt�Content-Type: multipart/mixed; boundary="BOUNDARY"
MIME-Version: 1.0
Subject: A subject
To: aperson@dom.ain
From: bperson@dom.ain

--BOUNDARY
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit

hello world
--BOUNDARY--
)r�rr�rrwr��r7r8rr9s    r:�test_one_part_in_a_multipart�*TestMultipart.test_one_part_in_a_multipart�so��
�
"�
"����g�.��&��i��'��d��)��f�
�
���:�&��}�%��
���S��
�5�?�?���	r=c���URn[SS5nSUS'SUS'SUS'S	Ul[S
5nUR	U5 URS5 U"UR
5S5 g)
Nr�r�rrKr
r�rr�r+rtr�aContent-Type: multipart/mixed; boundary="BOUNDARY"
MIME-Version: 1.0
Subject: A subject
To: aperson@dom.ain
From: bperson@dom.ain


--BOUNDARY
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit

hello world
--BOUNDARY--
�r�rrrrwr�r�rs    r:�1test_seq_parts_in_a_multipart_with_empty_preamble�?TestMultipart.test_seq_parts_in_a_multipart_with_empty_preamble�sv��
�
"�
"����g�.��&��i��'��d��)��f�
�����}�%��
���S��
���:�&�
�5�?�?���	r=c���URn[SS5nSUS'SUS'SUS'SUl[S	5nUR	U5 URS
5 U"UR
5S5 g�Nr�r�rrKr
r�rr�rtr�rrrs    r:�0test_seq_parts_in_a_multipart_with_none_preamble�>TestMultipart.test_seq_parts_in_a_multipart_with_none_preamble��v��
�
"�
"����g�.��&��i��'��d��)��f�
�����}�%��
���S��
���:�&�
�5�?�?���	r=c���URn[SS5nSUS'SUS'SUS'SUl[S	5nUR	U5 URS
5 U"UR
5S5 gr"�r�rrrrwr�r�rs    r:�0test_seq_parts_in_a_multipart_with_none_epilogue�>TestMultipart.test_seq_parts_in_a_multipart_with_none_epilogue�r%r=c���URn[SS5nSUS'SUS'SUS'S	Ul[S
5nUR	U5 URS5 U"UR
5S5 g)
Nr�r�rrKr
r�rr�r+rtr�rr'rs    r:�1test_seq_parts_in_a_multipart_with_empty_epilogue�?TestMultipart.test_seq_parts_in_a_multipart_with_empty_epiloguesv��
�
"�
"����g�.��&��i��'��d��)��f�
�����}�%��
���S��
���:�&�
�5�?�?���	r=c���URn[SS5nSUS'SUS'SUS'S	Ul[S
5nUR	U5 URS5 U"UR
5S5 g)
Nr�r�rrKr
r�rr�r*rtr�aContent-Type: multipart/mixed; boundary="BOUNDARY"
MIME-Version: 1.0
Subject: A subject
To: aperson@dom.ain
From: bperson@dom.ain

--BOUNDARY
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit

hello world
--BOUNDARY--

r'rs    r:�.test_seq_parts_in_a_multipart_with_nl_epilogue�<TestMultipart.test_seq_parts_in_a_multipart_with_nl_epilogue+sv��
�
"�
"����g�.��&��i��'��d��)��f�
�����}�%��
���S��
���:�&�
�5�?�?���	r=c��URnURS5nU"[UR55S5 URS5nU"UR	5S5 U"[UR55S5 UR5HbnU"UR	5S5 U"[UR55S5 URS5nU"UR	5S5 Md g)N�
msg_36.txtr�r�zmultipart/alternativezmessage/external-bodyrrA)r3r4r`r_rJ)r7r8r9�msg1r��
subsubparts      r:�test_message_external_body�(TestMultipart.test_message_external_bodyFs���
�
�
���l�l�<�(��
�3�s��� �!�1�%����q�!��
�4� � �"�$;�<�
�3�t���!�"�A�&��'�'�)�G��w�'�'�)�+B�C��s�7�&�&�(�)�1�-� �,�,�Q�/�J��z�*�*�,�l�;�	*r=c�x�URS5nUR[UR55S5 g)Nz
msg_37.txtr�)r4r3r`r_rps  r:�test_double_boundary�"TestMultipart.test_double_boundarySs.���l�l�<�(������S�_�_�.�/��3r=c��URnURS5n[5n[R"X#5 U"UR5S5 g)Nz
msg_38.txtz�multipart/mixed
    multipart/mixed
        multipart/alternative
            text/plain
        text/plain
    text/plain
    text/plain
�r�r4rr!�
_structurer��r7r8r9r�s    r:�)test_nested_inner_contains_outer_boundary�7TestMultipart.test_nested_inner_contains_outer_boundaryZsG��
�
"�
"��
�l�l�<�(���j�����S�&�
�3�<�<�>��	r=c��URnURS5n[5n[R"X#5 U"UR5S5 g)Nz
msg_39.txtz�multipart/mixed
    multipart/mixed
        multipart/alternative
        application/octet-stream
        application/octet-stream
    text/plain
r:r<s    r:�test_nested_with_same_boundary�,TestMultipart.test_nested_with_same_boundarymsG��
�
"�
"���l�l�<�(���j�����S�&�
�3�<�<�>��	r=c�f�URS5nURUR5S5 g)Nz
msg_40.txtz�MIME-Version: 1.0
Content-Type: text/html; boundary="--961284236552522269"

----961284236552522269
Content-Type: text/html;
Content-Transfer-Encoding: 7Bit

<html></html>

----961284236552522269--
)r4r3r�rps  r:�test_boundary_in_non_multipart�,TestMultipart.test_boundary_in_non_multipart~s+���l�l�<�(���������+�	r=c���URn[R"S5nURUR	55 U"UR5S5 U"[
UR55S5 g)Nz�MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="    XXXX"

--    XXXX
Content-Type: text/plain


--    XXXX
Content-Type: text/plain

--    XXXX--
z    XXXXr�)r3r�rrr�r�r`r_r6s   r:� test_boundary_with_leading_space�.TestMultipart.test_boundary_with_leading_space�sb��
�
�
���'�'�)���	
����(�(�*�+�
�3����z�*�
�3�s��� �!�1�%r=c��[5RS5nURURS5R5S5 g)Nz�Content-Type: multipart/mixed; boundary="===============0012394164=="
MIME-Version: 1.0

--===============0012394164==
Content-Type: image/file1.jpg
MIME-Version: 1.0
Content-Transfer-Encoding: base64

YXNkZg==
--===============0012394164==--rzYXNkZg==)rr�r3r_rMs  r:�&test_boundary_without_trailing_newline�4TestMultipart.test_boundary_without_trailing_newline�s=���H���
#�

$��	
������q�)�5�5�7��Dr=c��[SS5nURUR[RR5 g)Nr�r�)rrzr�r��compat32rMs  r:�test_mimebase_default_policy�*TestMultipart.test_mimebase_default_policy�s*���[�'�*���
�
�a�h�h���� 5� 5�6r=c��[SS[RRS9nUR	UR[RR5 g)Nr�r�r�)rr�r�rVrzrMs  r:�test_mimebase_custom_policy�)TestMultipart.test_mimebase_custom_policy�s6���[�'�%�,�,�2F�2F�G���
�
�a�h�h���� 4� 4�5r=)r�r�r�N)r[r\r]r^r@rr	rrrrr#r(r+r.r4r7r=r@rCrFrIrMrPr_rZr=r:r�r�6sh��"�H,�$5�"�$�*�2�8�6�6�6�6<�4��&�"
�&�&E�7�6r=r�c�J�\rSrSrSrSrSrSrSrSr	Sr
S	rS
rSr
g)
�TestNonConformanti�c���URnURS5nU"UR5S5 U"UR5S5 U"UR	5S5 g)Nz
msg_14.txtrAr�r�)r3r4rJr�r�r6s   r:�test_parse_missing_minor_type�/TestNonConformant.test_parse_missing_minor_type�sT��
�
�
���l�l�<�(��
�3���!�<�0�
�3�#�#�%�v�.�
�3�"�"�$�g�.r=c���URnURn[5nSUS'U"UR5S5 U"UR	5S5 U"UR5S5 US	SUS'U"UR5S5 U"UR	5S5 U"UR5S5 [
5n[U5nURU5 U"UR5S5 g)Nr�rFr�rArBr�zContent-Type: foo

)
r3r�rr�r�rJrrr�r�)r7r8�neqr9r�r�s      r:�test_invalid_content_type�+TestNonConformant.test_invalid_content_type�s���
�
�
���#�#���i��$��N��
�3�#�#�%�v�.�
�3�"�"�$�g�.�
�3���!�<�0����#��N��
�3�#�#�%�v�.�
�3�"�"�$�g�.�
�3���!�<�0��J���a�L��	�	�	�#���A�J�J�L�1�2r=c�l�URnURS5nU"UR5S5 g)N�
msg_31.txtzm--BOUNDARY
Content-Type: text/plain

message 1

--BOUNDARY
Content-Type: text/plain

message 2

--BOUNDARY--
)r�r4r_r6s   r:�test_no_start_boundary�(TestNonConformant.test_no_start_boundary�s1��
�
"�
"���l�l�<�(��
�3�?�?���	r=c�l�URnURS5nU"UR5S5 g)Nz
msg_35.txtz�From: aperson@dom.ain
To: bperson@dom.ain
Subject: here's something interesting

counter to RFC 5322, there's no separating newline here
)r�r4r�r6s   r:�test_no_separating_blank_line�/TestNonConformant.test_no_separating_blank_line�s0��
�
"�
"���l�l�<�(��
�3�=�=�?��	r=c�H�URS5nURUS5 UR[UR5S5 URURS[R5 URURS[R5 g)Nz
msg_41.txtrr�rr�)	r4�
assertHasAttrr3r`rrr �NoBoundaryInMultipartDefect�!MultipartInvariantViolationDefectrps  r:�test_lying_multipart�&TestNonConformant.test_lying_multipart�s}���l�l�<�(�����3�	�*�����S�[�[�)�1�-����c�k�k�!�n�$�@�@�	B����c�k�k�!�n�$�F�F�	Hr=c�
�URS5nURS5RS5nUR[UR5S5 URURS[R5 g)Nz
msg_42.txtr�r)r4r_r3r`rrr �StartBoundaryNotFoundDefect)r7r�bads   r:�test_missing_start_boundary�-TestNonConformant.test_missing_start_boundary�sh�����\�*������"�.�.�q�1������S�[�[�)�1�-����c�k�k�!�n�$�@�@�	Br=c��Sn[R"[R"SUS35[RR
S9nUR
URSS9S5 URUSR/5 g)	N�base64 �#        Content-Transfer-Encoding: �'

        SGVsbG8uIFRlc3Rpbmc=
        r�Tr]rTrDrU)r7r�r9s   r:�.test_string_payload_with_extra_space_after_cte�@TestNonConformant.test_string_payload_with_extra_space_after_cte	s�����'�'����=$�$'�5�)	�9�)
��\�\�)�)�	+��
	
��������5�7H�I�����$?� @� H� H�"�Mr=c�8�[R"[R"S5[RR
S9nUR
URSS9S5 USnURUR[RR/5 g)NzZ        Content-Transfer-Encoding: base64 some text

        SGVsbG8uIFRlc3Rpbmc=
        r�Tr]rTrD)r�rr�r�r�rVr3r_rWrr �InvalidHeaderDefect)r7r9r�s   r:�-test_string_payload_with_extra_text_after_cte�?TestNonConformant.test_string_payload_with_extra_text_after_cte	s{���'�'����9�)
��\�\�)�)�	+��
	
��������5�7H�I��-�.��������e�l�l�.N�.N�-O�Pr=c�4�Sn[R"[R"SUS35[RR
S9nUSnUR
X15 UR
URSS9S5 URUR/5 g)	Nrnrorpr�rDTr]rT)
r�rr�r�r�rLr3r_rWr)r7r�r9�
pasted_ctes    r:�7test_string_payload_with_extra_space_after_cte_compat32�ITestNonConformant.test_string_payload_with_extra_space_after_cte_compat32!	s������'�'����=$�$'�5�)	�9�)
��\�\�*�*�	,��
�4�5�
�����)���������5�7H�I�������R�0r=rZN)r[r\r]r^rUrYr]r`rfrkrqruryr_rZr=r:rSrS�s3��/�3�*�"	�H�
B�	N�Q�
1r=rSc��\rSrSrSrSrSrSrSrSr	Sr
S	rS
rSr
SrS
rSrSrSrSrSrSrSrg)�TestRFC2047i0	c���URnSn[U5nU"U/SQ5 [U5nU"[U5S5 UR	URSS9S5 g)NzVRe: =?mac-iceland?q?r=8Aksm=9Arg=8Cs?= baz
 foo bar =?mac-iceland?q?r=8Aksm=9Arg=8Cs?=))sRe: N�s
r�ksm�rg�szmac-iceland)s
 baz foo bar Nr~u+Re: räksmörgås baz foo bar räksmörgåsrer�ziRe: =?mac-iceland?q?r=8Aksm=9Arg=8Cs?= baz foo bar =?mac-iceland?q?r=8Aksm?=
 =?mac-iceland?q?=9Arg=8Cs?=)r3rrr�r�r��r7r8r��dhr�s     r:�test_rfc2047_multiline�"TestRFC2047.test_rfc2047_multiline1	sj��
�
�
��
/��
�1�
��
�2�5�	6�
�R���
�3�v�;�D�	F����f�m�m�r�m�:�= �	!r=c��URnSn[U5nU"USS/5 [[U55nU"US5 g)Nz0=?ISO-8859-1?Q?Andr=E9?= Pirard <pirard@dom.ain>)sAndr�r?)s Pirard <pirard@dom.ain>NuAndré Pirard <pirard@dom.ain>�r3rr�rrs     r:�test_whitespace_keeper_unicode�*TestRFC2047.test_whitespace_keeper_unicodeB	sJ��
�
�
��>��
�1�
��
�2�+�3�5�	6��[��_�%��
�6�5�6r=c��URnSn[U5nU"U/SQ5 [[U55nU"US5 g)NzWThe =?iso-8859-1?b?cXVpY2sgYnJvd24gZm94?= jumped over the =?iso-8859-1?b?bGF6eSBkb2c=?=))sThe N)squick brown foxr?)s jumped over the N)slazy dogr?z,The quick brown fox jumped over the lazy dogr�)r7r8r�r��hus     r:� test_whitespace_keeper_unicode_2�,TestRFC2047.test_whitespace_keeper_unicode_2K	sF��
�
�
��e��
�1�
��
�2�K�	L�
��R��
!��
�2�=�>r=c�F�Sn[U5nURU/SQ5 g)Nz3Sm=?ISO-8859-1?B?9g==?=rg=?ISO-8859-1?B?5Q==?=sbord))sSmN���r?)srgN���r?)ssbordN�rr3�r7r�r�s   r:�test_rfc2047_missing_whitespace�+TestRFC2047.test_rfc2047_missing_whitespaceT	s&��A��
�1�
������0�	1r=c�F�Sn[U5nURU/SQ5 g)Nz7Sm =?ISO-8859-1?B?9g==?= rg =?ISO-8859-1?B?5Q==?= sbord))sSm Nr�)s rg Nr�)s sbordNr�r�s   r:�test_rfc2047_with_whitespace�(TestRFC2047.test_rfc2047_with_whitespace[	s&��E��
�1�
������1�	2r=c�h�Sn/SQnUH&up4[X-5nURXTS4/5 M( g)Nz=?iso-8859-1?B?%s?=))zdm==�v)zdm=r�)�dmr�)zdmk=�vi)�dmkr�r?r�)r7r�ra�q�ar�s      r:�test_rfc2047_B_bad_padding�&TestRFC2047.test_rfc2047_B_bad_paddingb	s>��!�����D�A��q�u�%�B����R�l�"3�!4�5�r=c�@�SnUR[U5S/5 g)Nz=?iso-8859-1?Q?andr=e9=zz?=)sandr�=zzr?�r3r�r7r�s  r:�test_rfc2047_Q_invalid_digits�)TestRFC2047.test_rfc2047_Q_invalid_digitsl	s"��)������q�)�7�8�	:r=c�B�SnUR[U5/SQ5 g)Nz(=?ISO-8859-1?Q?a?=))��(N��ar?��)Nr�r�s  r:�test_rfc2047_rfc2047_1�"TestRFC2047.test_rfc2047_rfc2047_1r	s ��"������q�)�>�	@r=c�B�SnUR[U5/SQ5 g)Nz(=?ISO-8859-1?Q?a?= b))r�r�)s b)Nr�r�s  r:�test_rfc2047_rfc2047_2�"TestRFC2047.test_rfc2047_rfc2047_2x	� ��$������q�)�@�	Br=c�B�SnUR[U5/SQ5 g)Nz'(=?ISO-8859-1?Q?a?= =?ISO-8859-1?Q?b?=)�r�)sabr?r�r�r�s  r:�test_rfc2047_rfc2047_3�"TestRFC2047.test_rfc2047_rfc2047_3~	s ��5������q�)�?�	Ar=c�B�SnUR[U5/SQ5 g)Nz((=?ISO-8859-1?Q?a?=  =?ISO-8859-1?Q?b?=)r�r�r�s  r:�test_rfc2047_rfc2047_4�"TestRFC2047.test_rfc2047_rfc2047_4�	s ��6������q�)�?�	Ar=c�B�SnUR[U5/SQ5 g)Nz,(=?ISO-8859-1?Q?a?=
    =?ISO-8859-1?Q?b?=)r�r�r�s  r:�test_rfc2047_rfc2047_5a�#TestRFC2047.test_rfc2047_rfc2047_5a�	s ��<������q�)�?�	Ar=c�B�SnUR[U5/SQ5 g)Nz+(=?ISO-8859-1?Q?a?=
    =?ISO-8859-1?Q?b?=)r�r�r�s  r:�test_rfc2047_rfc2047_5b�#TestRFC2047.test_rfc2047_rfc2047_5b�	s ��:������q�)�?�	Ar=c�B�SnUR[U5/SQ5 g)Nz(=?ISO-8859-1?Q?a_b?=))r�)sa br?r�r�r�s  r:�test_rfc2047_rfc2047_6�"TestRFC2047.test_rfc2047_rfc2047_6�	r�r=c	��SnUR[U5/SQ5 UR[[U55R5UR	55 UR[[[U555S5 g)Nz((=?ISO-8859-1?Q?a?= =?ISO-8859-2?Q?_b?=))r�r�)s br|r�z(a b))r3rrr�r�r�r�s  r:�test_rfc2047_rfc2047_7�"TestRFC2047.test_rfc2047_rfc2047_7�	sk��6������q�)�
�	�	
����]�1�%5�6�=�=�?�����K�����[��q�)9�:�;�W�Er=c	�:�SnUR[U5SS/5 UR[[U55R5SR	UR555 UR[
[[U555S5 g)Nz9=?windows-1252?q?=22M=FCller_T=22?=
 <T.Mueller@xxx.com>)s
"M�ller T"zwindows-1252)s<T.Mueller@xxx.com>Nr+u"Müller T" <T.Mueller@xxx.com>)r3rrr�r��
splitlinesr�r�s  r:�test_multiline_header�!TestRFC2047.test_multiline_header�	s���I������q�)�
/�
+�
-�	.�	
����]�1�%5�6�=�=�?��������0�	2�����[��q�)9�:�;�:�	<r=c�@�SnUR[U5S/5 g)N�header without encoded words)r�Nr�r�s  r:�test_unencoded_ascii� TestRFC2047.test_unencoded_ascii�	s"��*������q�)�
3�4�	6r=c�@�SnUR[U5S/5 g)N�,header with unexpected non ASCII caractères)r�Nr�r�s  r:�test_unencoded_utf8�TestRFC2047.test_unencoded_utf8�	s#��<������q�)�
E�F�	Hr=rZN)r[r\r]r^r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r_rZr=r:r|r|0	se��!�"7�?�1�2�6�:�@�B�A�A�A�A�B�F�<�6�Hr=r|c�t�\rSrSrSrSrSrSrSrSr	Sr
S	rS
rSr
SrS
rSrSrSrSrSrg)�TestMIMEMessagei�	c�v�[SSS9nUR5UlSSS5 g!,(df   g=f)N�
msg_11.txtr[r�)r'r��_text�r7r�s  r:r@�TestMIMEMessage.setUp�	s'��
�l�W�
5������D�J�6�
5�
5�s�*�
8c�:�UR[[S5 g)Nza plain string)r�rvrr?s r:�test_type_error�TestMIMEMessage.test_type_error�	s�����)�[�2B�Cr=c�4�URnSn[5nX#S'[U5nU"UR5S5 UR	5nURU[5 U"[U5S5 USnURXc5 U"USU5 g)Nz
A sub-messagerKr�r�r�subject)	r3rrrJr_r�listr`rz)r7r8r�rrZrnr�s       r:�test_valid_argument�#TestMIMEMessage.test_valid_argument�	s���
�
�
��!���I���)����N��
�1����!1�2��-�-�/�����g�t�,�
�3�w�<����!�*���
�
�g�!�
�7�9��w�'r=c��[5nSUS'[5nSUS'[U5nUR[RUR
U5 g)N�	subpart 1rKz	subpart 2)rrr�r �MultipartConversionErrorrw)r7r2r�rZs    r:�test_bad_multipart�"TestMIMEMessage.test_bad_multipart�	sH���y��%��Y���y��%��Y���������&�9�9�1�8�8�T�Jr=c���[5nSUS'URS5 [U5nSUS'[5n[	U5nURU5 UR
UR5S5 g)N�An enclosed messagerK�!Here is the body of the message.
zThe enclosing messagez�Content-Type: message/rfc822
MIME-Version: 1.0
Subject: The enclosing message

Subject: An enclosed message

Here is the body of the message.
)rrVrrrr�r3r�)r7rrZr�r�s     r:�
test_generate�TestMIMEMessage.test_generate�	sg���I��,��)��	�
�
�:�;���N��.��)���J���a�L��	�	�	�!���������(�	r=c�X�URnURS5nU"UR5S5 UR5nUR	U[
5 U"[
U5S5 USnUR	U[5 U"USS5 U"UR5S5 g)Nr�r�r�rr�r�r�)r3r4rJr_rr�r`r)r7r8r9rn�submsgs     r:�test_parse_message_rfc822�)TestMIMEMessage.test_parse_message_rfc822�	s���
�
�
���l�l�<�(��
�3���!�#3�4��/�/�#�����g�t�,�
�3�w�<����������f�g�.�
�6�)��3�4�
�6����!E�Fr=c��URnURS5nU"UR5S5 URUR	55 U"[UR
55S5 UR
S5nU"UR5S5 U"UR
5S5 UR
S5nU"UR5S5 U"[UR
55S	5 UR
S5nURU[5 U"US
S5 U"URSS
S9S5 U"URSS
S9S5 UR
S5nURU[5 U"USS5 U"URSS9SS/5 U"URSSS9S5 UR
S	5nU"UR5S5 UR
5nURU[5 U"[U5S5 USnURU[5 U"UR5S5 U"USS5 g)N�
msg_16.txtryr�rrAa�This report relates to a message you sent with the following header fields:

  Message-id: <002001c144a6$8752e060$56104586@oxy.edu>
  Date: Sun, 23 Sep 2001 20:10:55 -0700
  From: "Ian T. Henry" <henryi@oxy.edu>
  To: SoCal Raves <scr@socal-raves.org>
  Subject: [scr] yeah for Ians!!

Your message cannot be delivered to the following recipients:

  Recipient address: jangel1@cougar.noc.ucla.edu
  Reason: recipient reached disk quota

r�zmessage/delivery-statusr�zoriginal-envelope-idz"0GK500B4HD0888@cougar.noc.ucla.edu�dnsz
reporting-mtar7r+�nsd�action�failedzoriginal-recipient)r�r+)zjangel1@cougar.noc.ucla.edur+r�zfinal-recipientr��
message-idz(<002001c144a6$8752e060$56104586@oxy.edu>)r3r4rJrr�r`r_rrrKr>r�)r7r8r9r��dsn1�dsn2rnr3s        r:�test_dsn�TestMIMEMessage.test_dsn�	s"��
�
�
���l�l�<�(��
�3���!�#5�6�����(�(�*�+�
�3�s��� �!�1�%��/�/�!�$��
�7�#�#�%�|�4�
�7��� �#�	�$�/�/�!�$��
�7�#�#�%�'@�A�
�3�w�"�"�$�%�q�)��"�"�1�%�����d�G�,�
�4�&�'�)M�N�
�4�>�>�%��>�8�"�=�
�4�>�>�%��>�8�$�?��"�"�1�%�����d�G�,�
�4��>�8�$�
�4�?�?�"6�?�7��?�@�	B�
�4�>�>�(�+<�>�=�r�B��/�/�!�$��
�7�#�#�%�'7�8��%�%�'�����g�t�,�
�3�w�<����Q�Z�
����j�'�2�
�:�&�&�(�,�7�
�:�l�#�5�	7r=c���URn[SSS9nUR5nSSS5 [5nSUS'SUS'SUS	'S
UlSUl[
S5n[
S
5nURSSSS9 URU5 URU5 [5n[U5nURU5 U"UR5W5 g!,(df   N�=f)N�
msg_21.txtr[r�r
r�rr�r�rK�MIME messagezEnd of MIME message
r�r�rFrtr�r�)
r�r'r�rrrrr�rwrrr�r�)	r7r8r�r�r9r2r�r�r�s	         r:�
test_epilogue�TestMIMEMessage.test_epilogue4
s���
�
"�
"��
�l�W�
5���7�7�9�D�6��i��'��F��%��D�	���I��%���.��������������~�'8�:��N��
�
�4���
�
�4���j���c�N��	�	�	�#��
�3�<�<�>�4� �!6�
5�s�C�
C,c�*�URn[5nSUS'SUS'SUS'SUlSUl[	S	5n[	S
5nURSSS
S9 UR
U5 UR
U5 U"UR5S5 g)Nr
r�rr�r�rKr�r+r�r�rFrtr�r�adFrom: aperson@dom.ain
To: bperson@dom.ain
Subject: Test
Content-Type: multipart/mixed; boundary="BOUNDARY"

MIME message
--BOUNDARY
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit

One
--BOUNDARY
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit

Two
--BOUNDARY--
)r�rrrrr�rwr�)r7r8r9r2r�s     r:�test_no_nl_preamble�#TestMIMEMessage.test_no_nl_preambleH
s���
�
"�
"���i��'��F��%��D�	���I��%�����������������~�'8�:��N��
�
�4���
�
�4��
�3�=�=�?��	r=c��URn[SSS9n[R"U5nSSS5 WR	S5nU"UR5S5 U"UR
5S5 UR	S5nU"UR5S5 U"UR
5S5 UR	S5nU"UR5S5 U"UR
5S5 UR	S5nU"UR5S5 U"UR
5S5 g!,(df   GN=f)Nr�r[r�rr�r�rA�r3r'r��message_from_filer_�get_default_typerJ�r7r8r�r9�
container1�
container2�container1a�container2as        r:�test_default_type�!TestMIMEMessage.test_default_typek
���
�
�
��
�l�W�
5���)�)�"�-�C�6��_�_�Q�'�
�
�:�&�&�(�*:�;�
�:�&�&�(�*:�;��_�_�Q�'�
�
�:�&�&�(�*:�;�
�:�&�&�(�*:�;� �,�,�Q�/��
�;�'�'�)�<�8�
�;�'�'�)�<�8� �,�,�Q�/��
�;�'�'�)�<�8�
�;�'�'�)�<�8�6�
5���D3�3
Ec��URn[SSS9n[R"U5nSSS5 WR	S5nU"UR5S5 U"UR
5S5 UR	S5nU"UR5S5 U"UR
5S5 UR	S5nU"UR5S5 U"UR
5S5 UR	S5nU"UR5S5 U"UR
5S5 g!,(df   GN=f)Nr�r[r�rr�r�rArrs        r:�.test_default_type_with_explicit_container_type�>TestMIMEMessage.test_default_type_with_explicit_container_type|
rr
c���URnURn[SS5nSUl[	S5n[	S5n[U5n[U5nUR
U5 UR
U5 U"UR5S5 U"UR5S5 U"UR5S5 U"UR5S5 U"URS5S5 US		US
	US		US
	U"UR5S5 U"UR5S5 U"UR5S5 U"UR5S5 U"URS5S5 g)N�digestr�r+�
message 1
�
message 2
r�ra�Content-Type: multipart/digest; boundary="BOUNDARY"
MIME-Version: 1.0

--BOUNDARY
Content-Type: message/rfc822
MIME-Version: 1.0

Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit

message 1

--BOUNDARY
Content-Type: message/rfc822
MIME-Version: 1.0

Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit

message 2

--BOUNDARY--
rBr@aBContent-Type: multipart/digest; boundary="BOUNDARY"
MIME-Version: 1.0

--BOUNDARY

Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit

message 1

--BOUNDARY

Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit

message 2

--BOUNDARY--
)
r3r�rrrrrwrJrr�)r7r8rXr��	subpart1a�	subpart2a�subpart1�subpart2s        r:�test_default_type_non_parsed�,TestMIMEMessage.test_default_type_non_parsed�
sf��
�
�
���#�#��!�(�J�7�	��	���]�+�	��]�+�	��y�)���y�)������"�����"�
�8�$�$�&�(8�9�
�8�$�$�&�(8�9�
�8�$�$�&�(8�9�
�8�$�$�&�(8�9��I����"�%�	�4
�^�$��^�$��^�$��^�$�
�8�$�$�&�(8�9�
�8�$�$�&�(8�9�
�8�$�$�&�(8�9�
�8�$�$�&�(8�9��I����"�%�	r=c��URn[S5n[S5n[X#4S9nU"[UR	55S5 U"UR	S5U5 U"UR	S5U5 g)Nr+)�	_subpartsr�rr�)r3rrr`r_)r7r8�text1�text2r9s     r:�$test_mime_attachments_in_constructor�4TestMIMEMessage.test_mime_attachments_in_constructor�
sg��
�
�
�����������u�n�5��
�3�s��� �!�1�%�
�3�?�?�1��u�%�
�3�?�?�1��u�%r=c�V�[5nURUR55 grn)rrr�rps  r:�"test_default_multipart_constructor�2TestMIMEMessage.test_default_multipart_constructor�
s���o������(�(�*�+r=c�r�[5nSUS'SUS'URURS5SS/5 g)N�a@b.comr��c@d.comr�)rr3r5rps  r:�test_multipart_default_policy�-TestMIMEMessage.test_multipart_default_policy�
s9���o����D�	���D�	�������T�*�Y�	�,B�Cr=c��[[RRS9nSUS'UR	[
5nSUS'SSS5 UR
[WR5S5 g!,(df   N4=f)Nr�r%r�r&z.There may be at most 1 To headers in a message)	rr�r�rVr�r�r3r��	exception)r7r9�cms   r:�test_multipart_custom_policy�,TestMIMEMessage.test_multipart_custom_policy�
sc���5�<�<�#7�#7�8����D�	�
�
�
�z�
*�b�!�C��I�+�����R�\�\�*�I�	K�+�
*�s�A0�0
A>)r�N)r[r\r]r^r@r�r�r�r�r�r�r�r�r
rrrr"r'r,r_rZr=r:r�r��	s[��#�D�(�K��(
G�77�r!�(!�F9�"9�"H�T&�,�D�Kr=r�c� �\rSrSrSrSrSrg)�TestNonMultiparti�
c�Z�[SS5nURUR55 g)Nr�r�)rr�r�rps  r:�"test_nonmultipart_is_not_multipart�3TestNonMultipart.test_nonmultipart_is_not_multipart�
s%���v�w�/������)�)�+�,r=c��[5nSUS'[SS5nUR[RUR
U5 g)Nr�rKr�r�)rrr�r r�rw)r7r9rZs   r:�test_attach_raises_exception�-TestNonMultipart.test_attach_raises_exception�
s:���i��$��I���V�W�-�����&�9�9�1�8�8�S�Ir=rZN)r[r\r]r^r1r4r_rZr=r:r/r/�
s
��-�Jr=r/c��\rSrSrSrSrSSjrSrSrSr	Sr
S	rS
rSr
SrS
rSrSrSrSrSrSrSrSrSrSrSrSrSrSrg)�TestIdempotentir*c��[USS9nUR5nSSS5 [R"W5nXC4$!,(df   N'=f�Nr[r��r'r�r�r�r7r!r�rar9s     r:r4�TestIdempotent._msgobj	s?��
�h��
1�R��7�7�9�D�2��'�'��-���y��2�
1�s	�=�
Ac��URn[5n[USS9nURXS9 U"X%R	55 g)Nrr	r�)r�rrr�r�)r7r9r�r�r8r�r�s       r:�_idempotent�TestIdempotent._idempotents<��
�
"�
"���J���a�a�(��	�	�	�#�	�)�
�4����r=c��URnURS5up#U"UR5S5 U"UR5S5 U"UR	5S5 U"UR5SS5 U"UR
S5S5 U"URS5 U"URS5 URX#5 g)	Nr�rAr�r�r�)rCrQrCrQ)
r3r4rJr�r�r>rKrrr>�r7r8r9r�s    r:�test_parse_text_message�&TestIdempotent.test_parse_text_messages���
�
�
���L�L��.�	��
�3���!�<�0�
�3�#�#�%�v�.�
�3�"�"�$�g�.�
�3�>�>��A�� 7�8�
�3�=�=��#�Z�0�
�3�<�<���
�3�<�<�������#r=c���URnURS5up#U"UR5S5 U"UR5S5 U"UR	S5S5 URX#5 g)Nr�rArC)r3r4rJr>rKr>rAs    r:�test_parse_untyped_message�)TestIdempotent.test_parse_untyped_message"sb��
�
�
���L�L��.�	��
�3���!�<�0�
�3�>�>��T�"�
�3�=�=��#�T�*�����#r=c�L�URS5upURX5 g)Nr��r4r>�r7r9r�s   r:�test_simple_multipart�$TestIdempotent.test_simple_multipart*� ���L�L��.�	������#r=c�L�URS5upURX5 g)N�
msg_02.txtrHrIs   r:�test_MIME_digest�TestIdempotent.test_MIME_digest.rLr=c�L�URS5upURX5 g)Nz
msg_27.txtrHrIs   r:�test_long_header�TestIdempotent.test_long_header2rLr=c�L�URS5upURX5 g)Nr�rHrIs   r:�"test_MIME_digest_with_part_headers�1TestIdempotent.test_MIME_digest_with_part_headers6rLr=c�L�URS5upURX5 g)N�
msg_06.txtrHrIs   r:�test_mixed_with_image�$TestIdempotent.test_mixed_with_image:rLr=c�L�URS5upURX5 g)NrwrHrIs   r:�test_multipart_report�$TestIdempotent.test_multipart_report>rLr=c�L�URS5upURX5 g)Nr�rHrIs   r:r��TestIdempotent.test_dsnBrLr=c�L�URS5upURX5 g)Nr�rHrIs   r:�test_preamble_epilogue�%TestIdempotent.test_preamble_epilogueFrLr=c�L�URS5upURX5 g)Nz
msg_23.txtrHrIs   r:�test_multipart_one_part�&TestIdempotent.test_multipart_one_partJrLr=c�L�URS5upURX5 g)Nz
msg_24.txtrHrIs   r:�test_multipart_no_parts�&TestIdempotent.test_multipart_no_partsNrLr=c�L�URS5upURX5 g)Nr\rHrIs   r:r]�%TestIdempotent.test_no_start_boundaryRrLr=c�L�URS5upURX5 g)N�
msg_32.txtrHrIs   r:�test_rfc2231_charset�#TestIdempotent.test_rfc2231_charsetVrLr=c�L�URS5upURX5 g)Nz
msg_33.txtrHrIs   r:�test_more_rfc2231_parameters�+TestIdempotent.test_more_rfc2231_parametersZrLr=c�L�URS5upURX5 g)Nz
msg_34.txtrHrIs   r:�%test_text_plain_in_a_multipart_digest�4TestIdempotent.test_text_plain_in_a_multipart_digest^rLr=c�L�URS5upURX5 g)Nzmsg_12a.txtrHrIs   r:�test_nested_multipart_mixeds�+TestIdempotent.test_nested_multipart_mixedsbs ���L�L��/�	������#r=c�L�URS5upURX5 g)Nr1rHrIs   r:�%test_message_external_body_idempotent�4TestIdempotent.test_message_external_body_idempotentfrLr=c�J�URS5upURXSS9 g)N�
msg_43.txtTr�rHrIs   r:�test_message_delivery_status�+TestIdempotent.test_message_delivery_statusjs%���L�L��.�	������T��2r=c�L�URS5upURX5 g�N�
msg_45.txtrHrIs   r:�test_message_signed_idempotent�-TestIdempotent.test_message_signed_idempotentnrLr=c�2�URnURS5up#U"UR5S5 0nUR5H	upVXdU'M U"USS5 U"USS5 U"URSUR
-5 U"URUR
5 U"[UR55S5 URS	5nU"UR5S
5 U"UR5SUR
-5 URS5nU"UR5S
5 U"UR5SUR
-5 URS
5n	U"U	R5S5 URU	[5 U	R5n
URU
[5 U"[U
5S5 U
S	nURU[5 U"UR5SUR
-5 g)Nrwryrzr{rBr}z$This is a MIME-encapsulated message.r�rrAzYadda yadda yaddar�r�r�)r3r4rJr>rr�rr`r_rrr�)r7r8r9r��params�pk�pvr2r��msg3rn�msg4s            r:�test_content_type� TestIdempotent.test_content_typers���
�
�
���L�L��.�	��
�3���!�#5�6����n�n�&�F�B��2�J�'�
�6�-� �"3�4�
�6�*��F�G�
�3�<�<�?�$�,�,�N�O�
�3�<�<����&�
�3�s��� �!�1�%����q�!��
�4� � �"�L�1�
�4����2�T�\�\�A�B����q�!��
�4� � �"�L�1�
�4����2�T�\�\�A�B����q�!��
�4� � �"�$4�5����d�G�,��"�"�$�����g�t�,�
�3�w�<����q�z�����d�G�,�
�4����2�T�\�\�A�Br=c���URnURS5up#U"UR5S5 UR5nUR	U[
5 U"[
U5S5 USnUR	U[5 U"UR5S5 UR	UR5[5 U"UR5UR5 g)NrXr�r�rrA)
r3r4rJr_rr�r`rr�r�)r7r8r9r�rnr2s      r:�test_parser�TestIdempotent.test_parser�s���
�
�
���L�L��.�	��
�3���!�#3�4��/�/�#�����g�t�,�
�3�w�<����q�z�����d�G�,�
�4� � �"�L�1����d�.�.�0�#�6�
�4����t�|�|�,r=rZN�F)r[r\r]r^r�r4r>rBrErJrOrRrUrYr\r�rardrgr]rmrprsrvryr}r�r�r�r_rZr=r:r7r7s����G���
$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�3�$�C�>-r=r7c���\rSrSrSrSrSrSrSrSr	Sr
S	rS
rSr
SrS
rSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSr Sr!S r"S!r#S"r$S#r%S$r&S%r'S&r(S'r)S(r*S)r+S*r,S+r-S,r.\/R`"5\1Rd"S-5S.55r3S/r4S0r5S1r6S2r7S3r8S4r9S5r:S6r;S7r<S8r=S9r>S:r?S;r@S<rAS=rBS>rCg?)@�TestMiscellaneousi�c� �[SSS9nUR5nSSS5 [R"W5n[	5n[USS9nUR
U5 URX$R55 g!,(df   Ni=f�Nr�r[r�rr	�	r'r�r�rrrr�r3r��r7r�r�r9r�r�s      r:�test_message_from_string�*TestMiscellaneous.test_message_from_string�sk��
�l�W�
5���7�7�9�D�6��'�'��-���J��
�a�a�(��	�	�	�#������z�z�|�,�6�
5�s�A?�?
B
c�B�[SSS9nUR5nURS5 [R"U5n[5n[
USS9nURU5 URX$R55 SSS5 g!,(df   g=fr�)
r'r��seekr�rrrr�r3r�r�s      r:�test_message_from_file�(TestMiscellaneous.test_message_from_file�st��
�l�W�
5���7�7�9�D��G�G�A�J��)�)�"�-�C��
�A��!�!�,�A�
�I�I�c�N����T�:�:�<�0�6�
5�
5�s�A<B�
Bc��[SSS9nUR5nSSS5 "SS[5n[R"WU5nURXC5 [SSS9nUR5nSSS5 [R"X#5nUR
5HnURXS5 M g!,(df   N�=f!,(df   N^=f)Nr�r[r�c��\rSrSrSrg)�HTestMiscellaneous.test_message_from_string_with_class.<locals>.MyMessagei�rZN�r[r\r]r^r_rZr=r:�	MyMessager�����r=r�rN)r'r�rr�rr�walk)r7r�r�r�r9r�s      r:�#test_message_from_string_with_class�5TestMiscellaneous.test_message_from_string_with_class�s���
�l�W�
5���7�7�9�D�6�	��	��'�'��i�8�����c�-�
�l�W�
5���7�7�9�D�6��'�'��8���x�x�z�G��!�!�'�5�"�6�
5��6�
5�s�B=�%C�=
C�
Cc�~�"SS[5n[SSS9n[R"X!5nSSS5 UR	WU5 [SSS9n[R"X!5nSSS5 UR5HnUR	XA5 M g!,(df   Nr=f!,(df   NH=f)Nc��\rSrSrSrg)�FTestMiscellaneous.test_message_from_file_with_class.<locals>.MyMessagei�rZNr�rZr=r:r�r��r�r=r�r�r[r�rN)rr'r�rrr�)r7r�r�r9r�s     r:�!test_message_from_file_with_class�3TestMiscellaneous.test_message_from_file_with_class�s���	��	��l�W�
5���)�)�"�8�C�6����c�9�-�
�l�W�
5���)�)�"�8�C�6��x�x�z�G��!�!�'�5�"�
6�
5��6�
5�s�B�B.�
B+�.
B<c�h�"SS[5nURSU5nURX!5 g)Nc�(^�\rSrSrU4SjrSrU=r$)�STestMiscellaneous.test_custom_message_does_not_require_arguments.<locals>.MyMessagei�c�">�[TU]5 grn)�super�__init__)r7�	__class__s �r:r��\TestMiscellaneous.test_custom_message_does_not_require_arguments.<locals>.MyMessage.__init__�s����� �"r=rZ)r[r\r]r^r�r_�
__classcell__)r�s@r:r�r��s
���
#�
#r=r�zSubject: test

test)r�_str_msgr)r7r�r9s   r:�.test_custom_message_does_not_require_arguments�@TestMiscellaneous.test_custom_message_does_not_require_arguments�s/��	#��	#��m�m�3�Y�?�����c�-r=c�h�[S5nUR[UR5/SQ5 g)Nr�)rrCrr �
feedparserr�r�r!r^�message_from_binary_filerrrrfr�r"r#)�
__import__r3�sorted�__all__)r7�modules  r:�test__all__�TestMiscellaneous.test__all__�s*���G�$���������/�2�	r=c���[R"5nUR[R"[R"U55SS[R
"U5SS5 g)N�)r�r3r#�	parsedate�
formatdate�gmtime�r7r�s  r:�test_formatdate�!TestMiscellaneous.test_formatdate�sK���i�i�k���������)9�)9�#�)>�?���C����S�)�"�1�-�	/r=c	���[R"5nUR[R"[R"USS95SS[R
"U5SS5 g)NT�r�r�)r�r3r#r�r�r�r�s  r:�test_formatdate_localtime�+TestMiscellaneous.test_formatdate_localtime�sN���i�i�k������O�O�E�,�,�S�D�A�B�2�A�F��N�N�3����#�	%r=c	�h�[R"5nUR[R"USS9[R"S[R
"U555 UR[R"USSS9[R"S[R
"U555 g)NFr�z%a, %d %b %Y %H:%M:%S -0000T)r��usegmtz%a, %d %b %Y %H:%M:%S GMT)r�r3r#r�r�r�r�s  r:�test_formatdate_usegmt�(TestMiscellaneous.test_formatdate_usegmt�s���i�i�k��������S�E�2��M�M�7����S�9I�J�	L�	
������S�E�$�?��M�M�5�t�{�{�3�7G�H�	Jr=c��/SQnUHenURUS9 UR[R"U55 UR[R"U55 SSS5 Mg UR[R"S55 UR[R"S55 g!,(df   M�=f)N)	r+r,�0zA Complete Waste of Timez Wed, 3 Apr 2002 12.34.56.78+0800z17 June , 2022zFriday, -Nov-82 16:14:55 ESTzFriday, Nov--82 16:14:55 ESTzFriday, 19-Nov- 16:14:55 EST)�dtstr)r]rr#r��parsedate_tz)r7�
invalid_datesr�s   r:�/test_parsedate_returns_None_for_invalid_strings�ATestMiscellaneous.test_parsedate_returns_None_for_invalid_stringss���

�
�#�E����E��*��!�!�%�/�/�%�"8�9��!�!�%�"4�"4�U�";�<�+�*�#�
	
���%�/�/�$�/�0����%�,�,�T�2�3�+�*�s�AB;�;
C
	c���UR[R"S5S5 UR[R"S5S5 UR[R"S5S5 g)NzWed, 3 Apr 2002 14:58:26 +0800�
��r�r���:�rr�r��pzWed,3 Apr 2002 14:58:26 +0800zWed 3 Apr 2002 14:58:26 +0800�r3r#r�r?s r:�test_parsedate_compact�(TestMiscellaneous.test_parsedate_compactsf������+�+�,L�M�B�	D�	
����+�+�,K�L�B�	D�	
����+�+�,K�L�B�	Dr=c��URnU"[R"S5S5 U"[R"S5S5 g)N�5 Feb 2003 13:47:26 -0800�
��r���
�/r�rr�r�透��zFebruary 5, 2003 13:47:26 -0800r��r7r8s  r:�test_parsedate_no_dayofweek�-TestMiscellaneous.test_parsedate_no_dayofweek!s?��
�
�
��
�5���9�:�5�	7�
�5���?�@�5�	7r=c�P�UR[R"S5S5 g)NzWed, 3 Apr 2002 14:58:26+0800r�r�r?s r:�.test_parsedate_no_space_before_positive_offset�@TestMiscellaneous.test_parsedate_no_space_before_positive_offset(s!������+�+�,K�L�4�	6r=c�P�UR[R"S5S5 g)NzWed, 3 Apr 2002 14:58:26-0800)
r�r�r�r�r�r�rr�r�r�r�r?s r:�.test_parsedate_no_space_before_negative_offset�@TestMiscellaneous.test_parsedate_no_space_before_negative_offset,s!������+�+�,K�L�5�	7r=c��URnU"[R"S5S5 U"[R"S5S5 g)Nz5 Feb 2003 13.47.26 -0800r�z5 Feb 2003 13.47 -0800)
r�r�r�r�r�rrr�r�r�r�r�s  r:�%test_parsedate_accepts_time_with_dots�7TestMiscellaneous.test_parsedate_accepts_time_with_dots1s?��
�
�
��
�5���9�:�5�	7�
�5���6�7�4�	6r=c�P�UR[R"S5S5 g)NzFriday, 19-Nov-82 16:14:55 EST)
i����r��7rr�r�i����r�r?s r:�test_parsedate_rfc_850�(TestMiscellaneous.test_parsedate_rfc_8508s!������+�+�,L�M�7�	9r=c�P�UR[R"S5S5 g)NzWed, 3 Apr 2002 14:58 +0800�
r�r�r�r�r�rrr�r�r�r�r?s r:�test_parsedate_no_seconds�+TestMiscellaneous.test_parsedate_no_seconds<s"������+�+�,I�J�A�	Cr=c��UR[R"S5S5 UR[R"S5S5 g)NzWed, 3 Apr 2002 14.58.26 +0800r�zWed, 3 Apr 2002 14.58 +0800r�r�r?s r:�!test_parsedate_dot_time_delimiter�3TestMiscellaneous.test_parsedate_dot_time_delimiter@sB������+�+�,L�M�B�	D�����+�+�,I�J�A�	Cr=c
�$�URn[R"S5n[[R
"U55nU"[R"U5SSUSS5 U"[[R"SU55S5 [R"S5n[[R
"USS55nU"[R"U5SSUSS5 U"[[R"SUSS55S5 g)Nr�r�z%Yr��	)	r3r#r��intr��mktimer�r�r�)r7r8�timetupr-s    r:�+test_parsedate_acceptable_to_time_functions�=TestMiscellaneous.test_parsedate_acceptable_to_time_functionsFs���
�
�
���/�/�"=�>������G�$�%��
�4�>�>�!��R�a� �'�"�1�+�.�
�3�t�}�}�T�7�+�,�d�3��$�$�%@�A������G�B�Q�K�(�)��
�4�>�>�!��R�a� �'�"�1�+�.�
�3�t�}�}�T�7�2�A�;�/�0�$�7r=c��UR[R"S5S5 UR[R"S5S5 g)N)
�r�r�rrrr�r�r�rr)
r
r�r�rrrr�r�r�i�i.���)r3r#�	mktime_tzr?s r:�test_mktime_tz� TestMiscellaneous.test_mktime_tzQsE��������*9�:�;<�	>�������*<�=�>C�	Er=c���UR[R"S5[R"S55 UR[R"S5[R"S55 g)Nz25 Feb 03 13:47:26 -0800z25 Feb 2003 13:47:26 -0800z25 Feb 71 13:47:26 -0800z25 Feb 1971 13:47:26 -0800r�r?s r:�test_parsedate_y2k�$TestMiscellaneous.test_parsedate_y2kWs\��	
����+�+�,F�G��+�+�,H�I�	K�����+�+�,F�G��+�+�,H�I�	Kr=c���UR[R"S5S5 UR[R"[R"S55S5 g)Nz<>rXr+�r3r#�	parseaddr�
formataddrr?s r:�test_parseaddr_empty�&TestMiscellaneous.test_parseaddr_emptyds?���������.��9�����)�)�%�/�/�$�*?�@�"�Er=c���UR[R"S5S5 UR[R"S5S5 UR[R"S5S5 g)Nza@b@crXza@b.c@cza@172.17.0.1@c�r3r#rr?s r:�test_parseaddr_multiple_domains�1TestMiscellaneous.test_parseaddr_multiple_domainshs^������O�O�G�$��	
�	
����O�O�I�&��	
�	
����O�O�,�-��	
r=c�P�UR[R"S5S5 g)N)zA Silly Person�person@dom.ainzA Silly Person <person@dom.ain>�r3r#rr?s r:�test_noquote_dump�#TestMiscellaneous.test_noquote_dumpvs"��������A�B�-�	/r=c��UR[R"S5S5 UR[R"S5S5 SnSnUR[R"[R"X455X45 g)N)zA (Very) Silly Personrz("A (Very) Silly Person" <person@dom.ain>z*"A \(Very\) Silly Person" <person@dom.ain>zA \(Special\) Personr�r3r#rr�r7r�rQs   r:�test_escape_dump�"TestMiscellaneous.test_escape_dump{sv��������H�I�7�	9�	
����O�O�I�J�7�	9�
$�����������)9�)9�1�&�)A�B�Q�F�Kr=c���UR[R"S5S5 SnSnUR[R"[R"X455X45 g)N)�Arthur \Backslash\ Foobarrz."Arthur \\Backslash\\ Foobar" <person@dom.ain>r&rr!r"s   r:�test_escape_backslashes�)TestMiscellaneous.test_escape_backslashes�sV��������M�N�=�	?�
)�����������)9�)9�1�&�)A�B�Q�F�Kr=c��SnSnSnSnUR[R"X45U5 UR[R"X4S5U5 g)N�Häns Würstr�-=?utf-8?b?SMOkbnMgV8O8cnN0?= <person@dom.ain>z0=?iso-8859-1?q?H=E4ns_W=FCrst?= <person@dom.ain>r?r)r7rL�addr�utf8_base64�
latin1_quopris     r:�test_quotes_unicode_names�+TestMiscellaneous.test_quotes_unicode_names�sU��%����E��J�
�����)�)�4�,�7��E�����)�)�4�,��E��	r=c�^�SnSnSnSm"U4SjS5nU"5nT<SU<S3nUR[R"X4U5U5 UR[R"X4[S	55U5 g)
Nr*rr+�FOOBARc�">�\rSrSrU4SjrSrg)�KTestMiscellaneous.test_accepts_any_charset_like_object.<locals>.CharsetMocki�c�>�T$rnrZ)r7�stringr�s  �r:�
header_encode�YTestMiscellaneous.test_accepts_any_charset_like_object.<locals>.CharsetMock.header_encode�s����
r=rZN)r[r\r]r^r7r_)r�s�r:�CharsetMockr4�s
���
�
r=r9z <�>r[)r3r#rr
)r7rLr,r-r9�mock�
mock_expectedr�s       @r:�$test_accepts_any_charset_like_object�6TestMiscellaneous.test_accepts_any_charset_like_object�sz���%����E����	�	��}��%+�T�2�
�����)�)�4�,��=�}�M�����)�)�4�,���8H�I��	r=c�n�SnSn[5nUR[[RX4U5 g)Nr*r)�objectr��AttributeErrorr#r)r7rLr,�bad_charsets    r:�-test_invalid_charset_like_object_raises_error�?TestMiscellaneous.test_invalid_charset_like_object_raises_error�s2��%�����h�����.�%�*:�*:�T�L��	r=c��SnUR[[RSU45 UR[[RSU45 g)Nupersön@dom.in�Name)r��UnicodeErrorr#r�r7r,s  r:�!test_unicode_address_raises_error�3TestMiscellaneous.test_unicode_address_raises_error�s?��#�����,��(8�(8�4��,�G����,��(8�(8�6�4�.�Ir=c��SnSnSup4UR[R"U5X445 UR[R"U5X445 UR[R"X445U5 g)NzJohn X. Doe <jxd@example.com>z"John X. Doe" <jxd@example.com>)zJohn X. Doezjxd@example.comr)r7r�yr�rQs     r:�test_name_with_dot�$TestMiscellaneous.test_name_with_dot�sf��+��-��1����������+�a�V�4��������+�a�V�4�����)�)�1�&�1�1�5r=c���URnU"[R"S5S5 U"[R"S5S5 U"[R"S5S5 g)N�""example" example"@example.com)r+rP�!"\"example\" example"@example.com)r+rQ�#"\\"example\\" example"@example.com)r+rRrr�s  r:�2test_parseaddr_preserves_quoted_pairs_in_addresses�DTestMiscellaneous.test_parseaddr_preserves_quoted_pairs_in_addresses�sT���
�
��
�5�?�?�<�=�
1�	3�
�5�?�?�@�A�
5�	7�
�5�?�?�D�E�
9�	;r=c��URS[R"S55 URS[R"S55 URS[R"S55 URS[R"S55 URS[R"S	55 g)
N)r+�merwok wok@xample.comrV)r+�merwok  wok@xample.comrWz merwok  wok  @xample.com)r+�merwok"wok"  wok@xample.comrX)r+zmerwok.wok.wok@xample.comzmerwok. wok .  wok@xample.comrr?s r:�-test_parseaddr_preserves_spaces_in_local_part�?TestMiscellaneous.test_parseaddr_preserves_spaces_in_local_part�s���	
���6��O�O�3�4�	6����7��O�O�4�5�	7����7��O�O�7�8�	:����<��O�O�9�:�	<����:��O�O�;�<�	>r=c��SnSnUR[R"U5U5 UR[R"U5U5 g)N)z#'foo@example.com' (foo@example.com)�foo@example.comz7"'foo@example.com' (foo@example.com)" <foo@example.com>r)r7r,�addrstrs   r:�6test_formataddr_does_not_quote_parens_in_quoted_string�HTestMiscellaneous.test_formataddr_does_not_quote_parens_in_quoted_string�sE��#��C���������1�4�8�����)�)�$�/��9r=c�T�SnUR[R"U5S5 g)NzFoo
	Bar <foo@example.com>)zFoo Barr\r)r7rs  r:�test_multiline_from_comment�-TestMiscellaneous.test_multiline_from_comment�s%��
��	
�������+�-K�Lr=c�P�UR[R"S5S5 g)N)zA Silly; Personrz""A Silly; Person" <person@dom.ain>rr?s r:�test_quote_dump�!TestMiscellaneous.test_quote_dump�s"��������B�C�1�	3r=c�T�URnURn[5n[5nU"US5 U"US5 U"US5 U"SU5 U"SU5 U"SU5 U"US5 U"US5 U"US5 U"SU5 U"SU5 U"SU5 U"X45 U"XC5 g)NrQ�US-ASCIIzUs-AsCiI�usascii�USASCII�UsAsCiI)r3�assertNotEqualr
)r7r8�ne�cset1�cset2s     r:�test_charset_richcomparisons�.TestMiscellaneous.test_charset_richcomparisons�s���
�
�
��
�
 �
 ���	���	��
�5�*��
�5�*��
�5�*��
�:�u��
�:�u��
�:�u��
�5�)��
�5�)��
�5�)��
�9�e��
�9�e��
�9�e��
�5��
�5�r=c�^�URnU"[R"SS/5SS/5 g)N�aperson@dom.ain (Al Person)zBud Person <bperson@dom.ain>�z	Al Personr
)z
Bud Personr�r3r#�getaddressesr�s  r:�test_getaddresses�#TestMiscellaneous.test_getaddresses
s9��
�
�
��
�5���<�=�?�@�,�-�/�	0r=c�X�UR[R"/SQ5/SQ5 g)N)z"Bud, Person" <bperson@dom.ain>rrz#"Mariusz Felisiak" <to@example.com>))zBud, Personrrs)zMariusz Felisiak�to@example.comrtr?s r:�test_getaddresses_comma_in_name�1TestMiscellaneous.test_getaddresses_comma_in_name
s(���������
�
�
	
r=c�p	�SnSnSnSSUS3U4/4SSU4USU4/4SSU4USU4U/4SSU4USU4/4S	SUS
US34/4SSU4USU4/4S
X3SU4/4SSU4USU4/4SSU4SU4/4SSUS-4SU4/4SSU4SSUS34/44H�upEUUSUS3nURUS9 UR[R"U/5U/5 UR[R"U/SS9U5 UR[R"U/5U5 UR[R"U/SS9SU45 SSS5 M� USUS3nUR[R"U/5SU4SU4/5 UR[R"U/SS9SU4SU4/5 UR[R"U/5U5 UR[R"U/SS9SU45 SnSnUR[R"U/5U/5 UR[R"U/SS9U/5 UR[R"U/5U5 UR[R"U/SS9SU45 SnSnUR[R"U/5U/5 UR[R"U/SS9U/5 UR[R"U/5U5 UR[R"U/SS9SU45 SnUR[R"U/5U/5 UR[R"U/SS9/SQ5 UR[R"U/5U5 UR[R"U/SS9SU45 SnUR[R"U/5SS/5 UR[R"U/SS9SS/5 UR[R"U/5U5 UR[R"U/SS9SU45 UR[
RRS5 g!,(df   GM:=f) N�alice@example.org�bob@example.comrX�(�<r:�)r+�[z[<z>]�]�@r\�:�.�")�addressF��strictz,<z,"Alice, alice@example.org" <bob@example.com>)zAlice, alice@example.orgr~zalice@example.org (Alice))�Alicer}zalice@example.org )Alice())r+r}rX)r+r��<"Jane Doe" <jane@example.net>, "John Doe" <john@example.net>)zJane Doezjane@example.net)zJohn Doezjohn@example.netT)r]r3r#rurr��supports_strict_parsing)r7�alice�bob�empty�invalid_separator�expected_non_strictr��expected_stricts        r:�test_parsing_errors�%TestMiscellaneous.test_parsing_errors#
s���#�������a��u�A�J��&�'�(�
�B��;���C�y�1�2�
�B��;���C�y�%�8�9�
�B��;���C�y�1�2�
�B�5�'��C�5��+�,�-�.�
�B��;���C�y�1�2�
�5�"�c��+�,�
�B��;���C�y�1�2�
�B��;��S�	�*�+�
�B����$�r�3�i�0�1�
�B��;��q���Q�Z� 0�1�2�7
�2���� 1�2�!�C�5��:�G����g��.�� � ��!3�!3�W�I�!>�"'��*�� � ��!3�!3�W�I�e�!L�!4�6�� � ����'��!;�!&�(�� � ����'��5�!I�"$�g��0�/�.�7
�6�G�2�c�U�!�$������+�+�W�I�6��u�+��C�y�1�	3�����+�+�W�I�e�D��u�+��C�y�1�	3�������'��3��	 �������'��5�A��g��	(�A��I������+�+�W�I�6��8I�J�����+�+�W�I�e�D��FW�X�������'��3�_�E�������'��5�A��g��	(�.��8������+�+�W�I�6��8I�J�����+�+�W�I�e�D��FW�X�������'��3�_�E�������'��5�A��g��	(�.������+�+�W�I�6���@�����+�+�W�I�e�D�M�	O�������'��3�U�;�������'��5�A��g��	(�Q������+�+�W�I�6�:�:�<�	=�	
����+�+�W�I�e�D�:�:�<�	=�	
������'��3�U�;�������'��5�A��g��	(�	
������<�<�d�C�/�.�s
�BR%�%
R5	c��S/S/4S/S/4SS/SS/4S/S/4S	/S/4S
//SQ4S/S
/4S/S/4S/S/4S/SS/44
HhupURUS9 UR[R"U5U5 UR[R"USS9U5 SSS5 Mj S/nUR[R"U5S/5 UR[R"USS9/SQ5 g!,(df   M�=f)Nu&"Sürname, Firstname" <to@example.com>)uSürname, Firstnameryzfoo: ;rXz#"Jason R. Mastaler" <jason@dom.ain>)zJason R. Mastalerz
jason@dom.ainz=Pete(A nice \) chap) <pete(his account)@silly.test(his host)>)z)Pete (A nice ) chap his account his host)zpete@silly.testz<(Empty list)(start)Undisclosed recipients  :(nobody(I know))z=Mary <@machine.tld:mary@example.net>, , jdoe@test   . example))�Maryzmary@example.netrX)r+zjdoe@test.examplez*John Doe <jdoe@machine(comment).  example>)zJohn Doe (comment)zjdoe@machine.examplez3"Mary Smith: Personal Account" <smith@home.example>)zMary Smith: Personal Accountzsmith@home.examplezUndisclosed recipients:;z7<boss@nil.test>, "Giant; \"Big\" Box" <bob@example.net>)r+z
boss@nil.test)zGiant; "Big" Boxzbob@example.net)�	addressesFr�z	[]*-- =~$)rXrX)r+z*--)r]r3r#ru)r7r�rs   r:�test_getaddresses_nasty�)TestMiscellaneous.test_getaddresses_nasty{
s���6�
7�7�
8�
:��Z��Z�
��=�
>��>�
?�
A�O�
O�N�
O�
Q�M�
M��Z�
�N�
N�
P�
R�;�
;�<�
=�
?�D�
D�D�
E�
G�)�
)��Z�
�I�
I�#�%L�
M�
O�9$
��I�>���	��2�� � ��!3�!3�I�!>�!)�+�� � ��!3�!3�I�e�!L�!)�+�3�2�?$
�J!�M�	�����+�+�I�6�"��	%�����+�+�I�e�D�:�	<�3�2�s
�
AC7�7
D	c�h�URn[R"S/5nU"USSS5 g)Nz%User ((nested comment)) <foo@bar.com>rr��foo@bar.comrt)r7r8�addrss   r:�"test_getaddresses_embedded_comment�4TestMiscellaneous.test_getaddresses_embedded_comment�
s3��
�
�
���"�"�$K�#L�M��
�5��8�A�;�
�&r=c�t�[R"[S5/5nURUSSS5 g)NzAl Person <aperson@dom.ain>rr�r
)r#rurr3)r7r�s  r:�test_getaddresses_header_obj�.TestMiscellaneous.test_getaddresses_header_obj�
s4���"�"�F�+H�$I�#J�K������q��!��&7�8r=�cpuc�|�"SS[5n[S5Vs/sH	o!"5PM nn[R"U5 SSS5 [	UVs/sHoDR
PM sn/5nUR
[[U55[U55 gs snf!,(df   Ng=fs snf)Nc��\rSrSrSrSrg)�BTestMiscellaneous.test_make_msgid_collisions.<locals>.MsgidsThreadi�
c���/UlURRn[Rn[R
nU"5S-nU"5U:aU"U"SS95 U"5U:aMgg)Ng@�testdomain-string��domain)�msgidsr�r#�
make_msgidr��	monotonic)r7r�r��clock�tfins     r:�run�FTestMiscellaneous.test_make_msgid_collisions.<locals>.MsgidsThread.run�
sY�� ������+�+��"�-�-�
������w��}���g��n��:�-@�A�B��g��nr=)r�N)r[r\r]r^r�r_rZr=r:�MsgidsThreadr��
s��
Cr=r�r�)	rr�r%�
start_threads�sumr�r3r`ra)r7r�r��threadsr-�all_idss      r:�test_make_msgid_collisions�,TestMiscellaneous.test_make_msgid_collisions�
s���		C�6�		C�,1��8�4�8�a�<�>�8��4�
�
+�
+�G�
4��5���1��A�x�x��1�2�6������S��\�*�C��L�9��	5�
4�
4��1s�B#�B(�B9�(
B6c��URn[5nURSSSS9 U"UR5S5 g)Nr�r�zfoo\wacky"namer�)r3rr�r�r6s   r:�test_utils_quote_unquote�*TestMiscellaneous.test_utils_quote_unquote�
sA��
�
�
���i�����,�l� 1�	�	3�
�3����0�1r=c�Z�[S5nURUR5S5 g)Nz
not a charsetr\�r
r3�get_body_encoding�r7rCs  r:�)test_get_body_encoding_with_bogus_charset�;TestMiscellaneous.test_get_body_encoding_with_bogus_charset�
s%���/�*������2�2�4�h�?r=c���URn[5nSUS'U"USS5 UR5nU"[U5S5 U"USS5 [	US5nU"UR5S5 UR
SUS	9 U"UR5S
5 U"URSS9S5 U"US
S5 [5nSUS'UR5nU"[U5S5 U"USS5 [	US5nU"UR5[R5 UR
SUS	9 U"UR5S5 U"US
S5 g)Nztext/plain; charset=UTF-8rFrBr�rr[r\r�r��aGVsbG8gd29ybGQ=
Tr]rDztext/plain; charset="US-ASCII"rQrtrp)
r3rrr`r
r�rVr_rr�)r7r8r9r�rCs     r:�-test_get_body_encoding_with_uppercase_charset�?TestMiscellaneous.test_get_body_encoding_with_uppercase_charset�
sS��
�
�
���i��9��N��
�3�~�� ;�<��#�#�%��
�3�x�=�!��
�8�A�;�� ��(�1�+�&��
�7�$�$�&��1�������8�
�3�?�?��2�3�
�3�?�?�$�?�'��8�
�3�*�+�X�6��i��>��N���#�#�%��
�3�x�=�!��
�8�A�;�
�#��(�1�+�&��
�7�$�$�&��(?�(?�@����
�w��7�
�3�?�?��m�,�
�3�*�+�V�4r=c��[S5n[S5nURUR5UR55 g)NrQrgr�)r7�lc�ucs   r:�test_charsets_case_insensitive�0TestMiscellaneous.test_charsets_case_insensitive�
s8��
�Z�
 ��
�Z�
 ������-�-�/��1E�1E�1G�Hr=c��URnURS5n[5n[R"X#5 U"UR5S5 g)Nr|aBmultipart/report
    text/plain
    message/delivery-status
        text/plain
        text/plain
        text/plain
        text/plain
        text/plain
        text/plain
        text/plain
        text/plain
        text/plain
        text/plain
        text/plain
        text/plain
        text/plain
        text/plain
        text/plain
        text/plain
        text/plain
        text/plain
        text/plain
        text/plain
        text/plain
        text/plain
        text/plain
        text/plain
        text/plain
        text/plain
    text/rfc822-headers
r:r<s    r:�1test_partial_falls_inside_message_delivery_status�CTestMiscellaneous.test_partial_falls_inside_message_delivery_status�
sG��
�
"�
"��
�l�l�<�(���j�����S�&�
�3�<�<�>��	r=c�d�UR[RRSS9SSS5 g)Nr�r�i��z@testdomain-string>�r3r�r#r�r?s r:�test_make_msgid_domain�(TestMiscellaneous.test_make_msgid_domains0������K�K�"�"�*=�"�>�s�t�D�!�	#r=c�f�UR[RRSSS9SSS5 g)Nz
test-idstringr�)�idstringr�i���z!.test-idstring@testdomain-string>r�r?s r:�test_make_msgid_idstring�*TestMiscellaneous.test_make_msgid_idstring s9������K�K�"�"�O�*�
#�
,�,/�D�
2�/�	1r=c���[S5nS=UlnUR[RR5SU-S-5 SSS5 g!,(df   g=f)Nzsocket.getfqdnzpythontest.example.comr�r:)r	�return_value�assertEndsWithr�r#r�)r7�mock_getfqdnr�s   r:�test_make_msgid_default_domain�0TestMiscellaneous.test_make_msgid_default_domain&sL��
�#�
$��1I�I�L�%�������� 6� 6� 8�#��,��:L�M�%�
$�
$�s�>A�
A!c�r�[SSSS9nUR5nSSS5 WRSS5n[R"U5n[5n[RRU5nURU5 URUR5U5 g!,(df   N�=f)N�
msg_26.txtr[r*�r��newliner�)r'r�rr�rrr�rr�r3r��r7�f�msgtxt�	msgtxt_nlr9r�r�s       r:�test_Generator_linend�'TestMiscellaneous.test_Generator_linend+s���
�l�W�d�
C�q��V�V�X�F�D��N�N�6�4�0�	��'�'��/���J���O�O�%�%�a�(��	�	�	�#���������y�1�D�
C�s�B(�(
B6c��[SSSS9nUR5nSSS5 WRSS5n[R"U5n[5n[RRU5nURUSS9 URUR5RS5U5 g!,(df   N�=f)Nr�r[r*r�r�r�r�)r'r�rr�rrr�r
r�r3r�r^r�s       r:�test_BytesGenerator_linend�,TestMiscellaneous.test_BytesGenerator_linend6s���
�l�W�d�
C�q��V�V�X�F�D��N�N�6�4�0�	��'�'�	�2���I���O�O�*�*�1�-��	�	�	�#�v�	�&��������,�,�W�5�v�>�D�
C�s�B6�6
Cc��[SS5nUR5nSSS5 WRSS5nURSS5n[R"U5n[5n[RRU5nURUSS9 URUR5U5 g!,(df   N�=f)	Nr�rdswith attachmentsfo��
rr�r�)r'r�rr�rrr�r
r�r3r�r�s       r:�)test_BytesGenerator_linend_with_non_ascii�;TestMiscellaneous.test_BytesGenerator_linend_with_non_asciiAs���
�l�D�
)�Q��V�V�X�F�*���� 2�I�>���N�N�7�E�2�	��&�&�y�1���I���O�O�*�*�1�-��	�	�	�#�v�	�&��������v�.�*�
)�s�B:�:
Cc�R�[SS5nUR5nSSS5 [SS5nUR5nSSS5 [S4[W44[W44[
[
544[S4[S4/nUH�upVURURSS9 U"U6nURUR[RR5 SSS5 URURSS9 U"US	[RR06nURUR[RR5 SSS5 M� g!,(df   GNJ=f!,(df   GN7=f!,(df   N�=f!,(df   GM"=f)
Nrvrdrc)r+)r�r�rL)�clsr�rVr�)r'r�rrrrrrrr]r[rzr�r�rLrV)r7r��	audiodatarj�classesr��constructorrs        r:�!test_mime_classes_policy_argument�3TestMiscellaneous.test_mime_classes_policy_argumentMsC��
�k�4�
(�B����	�I�)�
�l�D�
)�R��g�g�i�G�*��e�$�
���%�
��
�#�
�7�9�,�'�
�5�6�
�u��

��!(��C����#�,�,�z��B���%���
�
�a�h�h����(=�(=�>�C����#�,�,�y��A���B�U�\�\�-A�-A�B���
�
�a�h�h����(<�(<�=�B�A�	!(�)�
(��
)�
)��C�B��B�A�s/�E!�E3�#:F�?AF�!
E0�3
F�
F	�
F&	c���UR[[R"S55/SQ5 UR[[R"S55SS/5 g)Nza\\b\"c\\"d)�rr�)r��\\)r�rQ)r�z\")r��c)�r�)rr�)r��dza\r�)r��\)r3r�r#�_iter_escaped_charsr?s r:�test_iter_escaped_chars�)TestMiscellaneous.test_iter_escaped_charsbsQ������e�7�7��G�H�%�	&�	
����e�7�7��>�?�"�I�.�	0r=c�^�U4SjnU"SS5 U"SS5 U"SS5 U"SS	5 U"S
S5 U"SS
5 U"SS5 U"SS5 SH)nTR[R"U5U5 M+ g)Nc�R>�TR[R"U5U5 grn�r3r#�_strip_quoted_realnames)r,rr7s  �r:�check�<TestMiscellaneous.test_strip_quoted_realnames.<locals>.checkps������U�:�:�4�@�(�Kr=r�z( <jane@example.net>,  <john@example.net>z""Jane \"Doe\"." <jane@example.net>z <jane@example.net>zbefore"name"after�beforeafterzbefore"name"�beforezb"name"rQz"name"after�afterz"name"ar�z"name"r+)z8Jane Doe <jane@example.net>, John Doe <john@example.net>zlone " quoter)r7rr,s`  r:�test_strip_quoted_realnames�-TestMiscellaneous.test_strip_quoted_realnamesos����	L�	�L�8�	:�
�3�#�	%�	�"�M�2�
�o�x�(�
�j�#��
�n�g�&�
�j�#��
�i���
�D�
���U�:�:�4�@�$�G�	
r=c��SnUR[R"US355 UR[R"US355 UR[R"US355 UR[R"US355 UR[R"SU355 g)Nzalice@example.netz (Alice)z )Alice(z	 (Alice))z	 ((Alice)z")Alice((" )rr#�_check_parenthesisr�rHs  r:�test_check_parenthesis�(TestMiscellaneous.test_check_parenthesis�s���"������0�0�D�6��1B�C�D�����1�1�T�F�(�2C�D�E�����1�1�T�F�)�2D�E�F�����1�1�T�F�)�2D�E�F�	
����0�0�;�t�f�1E�F�Gr=rZN)Dr[r\r]r^r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrrrr#r'r/r=rCrIrMrSrYr^rardrorvrzr�r�r�r�r%�requires_working_threadingr$�requires_resourcer�r�r�r�r�r�r�r�r�r�r�r�r�r�rrr_rZr=r:r�r��si��	-�
1�6�"6�.��/�
%�J�4�,D�7�6�7�
6�9�C�C�	8�E�K�F�
�/�
	L�L��
��J�6�;�$>�$:�M�3�
�(0�
�"VD�p*<�X'�9�
�0�0�2����u�%�:�&�3�:�&2�@�5�4I�
(�T#�
1�N�
	2�	?�
/�>�*0�H�2Hr=r�c�2�\rSrSrSrSrSrSrSrSr	g)	�
TestIteratorsi�c�4�URnURnURS5n[R"U5n[U5nU"[
U5S5 U"[RU5UR55 URS5n[R"U5n[U5nU"[
U5S5 [SSS9nU"[RU5UR55 SSS5 g!,(df   g=f)Nr�r�rN�+z
msg_19.txtr[r�)r3r�r4r!�body_line_iteratorr�r`�EMPTYSTRINGr�r_r'r�)r7r8rXr9�itr�r�s       r:�test_body_line_iterator�%TestIterators.test_body_line_iterator�s���
�
�
���#�#���l�l�<�(��
�
)�
)�#�
.���R���
�3�u�:�q���K���U�#�S�_�_�%6�7��l�l�<�(��
�
)�
)�#�
.���R���
�3�u�:�r��
�l�W�
5���� � ��'�����3�6�
5�
5�s�+D	�	
Dc��URnURS5n[R"US5n/nSnUH'nUS-
nUR	UR55 M) U"US5 U"[RU5S5 g)Nr�r�rr�r�z`a simple kind of mirror
to reflect upon our own
a simple kind of mirror
to reflect upon our own
�r3r4r!�typed_subpart_iteratorr�r_rr��r7r8r9rr��subpartsr�s       r:�test_typed_subpart_iterator�)TestIterators.test_typed_subpart_iterator�s���
�
�
���l�l�<�(��
�
-�
-�c�6�
:�������G���M�H��L�L��,�,�.�/��	�8�Q��
�;���E�"�%�	r=c��URnURS5n[R"USS5n/nSnUH'nUS-
nUR	UR55 M) U"US5 U"[RU5S5 g)Nr�r�r�rr�z%
Hi,

Do you like this message?

-Me
rrs       r:�(test_typed_subpart_iterator_default_type�6TestIterators.test_typed_subpart_iterator_default_type�s���
�
�
���l�l�<�(��
�
-�
-�c�6�7�
C�������G���M�H��L�L��,�,�.�/��	�8�Q��
�;���E�"�%�	r=c
���/SQnSSKJnJn U"5n/nSnUH`upxURU5 Xh-
nSn	[	UR
U5Hn
UR
U
5 U	S-
n	M URX�5 Mb UR[U5U5 URSRUVVs/sHupxUPM	 snn5SRU55 gs snnf)N))za
 
r�)rQr)zc
r�)r+r)zd
r�)ze
r)z
fr�)r�r�r��BufferedSubFile�NeedMoreDatar�r+)
�email.feedparserr$r%�push�iter�readliner�r3r`r�)r7�imtr$r%�bsf�om�nt�il�n�n1�ols           r:�test_pushCR_LF�TestIterators.test_pushCR_LF�s���
	��	C����
��
���E�B��H�H�R�L��G�B��B��3�<�<��6���	�	�"�
��a���7�
���Q�#��	
����R��"�%�������#�!6�#���"�#�!6�7������E��!6s�4Cc�x^�SSKJnJn SnSnSmSRU4Sj[	U555S-nURS	5nU"5n/n[	S[
U5U5H?n	XYX�-n
URU
5 UR[URU55 MA URX�5 g)
Nrr#i'r�zabcd 	
r+c3�:># �UHn[T5v� M g7frnr)r�r��charss  �r:r��1TestIterators.test_push_random.<locals>.<genexpr>�s����4�8�a�F�5�M�M�8�s�r*T)r&r$r%r�r�r�r`r'�extendr(r)r3)r7r$r%r/�	chunksizer��targetr+r�r��chunkr6s           @r:�test_push_random�TestIterators.test_push_random�s����B����	����G�G�4�5��8�4�4�t�;�����d�#��������q�#�a�&�)�,�A����$�E��H�H�U�O��L�L��c�l�l�L�9�:�-�	
����'r=rZN)
r[r\r]r^rrr r2r<r_rZr=r:rr�s��4�"�"�&F�<(r=rc�,�\rSrSrSrSrSrSrSrg)�TestFeedParsersi�c�j�[5nUHnURU5 M UR5$rn)r)�feed�close)r7�chunksr�r;s    r:�parse�TestFeedParsers.parse�s.���\�
��E��O�O�E�"�����!�!r=c�z�URS5nURUSS5 URUSS5 g)NzFirst: val
: bad
Second: valr��valr�)rDr3rps  r:�test_empty_header_name_handled�.TestFeedParsers.test_empty_header_name_handleds9���j�j�9�:������W��u�-�����X���.r=c���URS/5nURUR5/SQ5 URS/5nURUR5/SQ5 URSS/5nURUR5SS/5 URSS	/5nURUR5SS
/5 URSS/5nURUR5SS
/5 URS/5nURUR5S
/5 UR/SQ5nURUR5SS/5 g)Nz
a:
b:
c:
d:
)r�rQr�r�za:
b:
c:
d:za:
b�c:
r��bc�a:
zb:
rQz
b:
ua:…b:
c:
)r�u	…b:
c:)rMub:…rK�r�r+)rQu…c:)rDr3r�r�rMs  r:�
test_newlines�TestFeedParsers.test_newlines	s3���J�J�,�-�.���������#7�8��J�J�*�+�,���������#7�8��J�J���(�)���������C��;�/��J�J���'�(���������C��:�.��J�J���)�*���������C��:�.�
�J�J�,�-�.���������%<�$=�>��J�J�1�2���������Y��$@�Ar=c��SupURS/SU-/U--5nURUR5S/5 URUR5SU-U-5 URS/SU-/U--5nURUR5S/5 URUR5SU-U-5 URS/SU-S-/U--5nURUR5S/5 URUR5SU-S-U-5 URSS/SU-/U--5nURUR5S	S
SU-U-4/5 g)N)i�i Nza:b

r)r�rQza:b

�…rMzb: rNrQ)rDr3r�r_)r7�Mr[rs    r:�test_long_lines�TestFeedParsers.test_long_linessZ������J�J�	�{�c�!�e�W�q�[�0�1���������Z�L�1��������#�a�%��'�2��J�J�	�{�c�!�e�W�q�[�0�1���������Z�L�1��������#�a�%��'�2��J�J�	�{�c�!�e�F�l�^�a�%7�7�8���������Z�L�1��������3�q�5��<��*:�;��J�J����#�a�%��1��4�5���������Y��c�!�e�A�g��$?�@r=rZN)	r[r\r]r^rDrHrOrTr_rZr=r:r?r?�s��"�/�B�$
Ar=r?c��\rSrSrSrSrSrSrSrSr	Sr
S	rS
rSr
SrS
rSrSrSrSrSrSrSrSrg
)�TestParsersi+c�z�URn[SSS9n[5RU5nSSS5 U"WSS5 U"USS5 U"UR	5S5 URUR
55 URUR5[5 g!,(df   N�=f)	NrNr[r�r��ppp-request@zzz.orgr��ppp@zzz.orgrt)
r3r'rrDrJr�r�rr_r��r7r8r�r9s    r:�test_header_parser�TestParsers.test_header_parser-s���
�
�
��
�l�W�
5���.�&�&�r�*�C�6�
�3�v�;�-�.�
�3�t�9�m�$�
�3���!�#4�5�����)�)�+�,����c�o�o�/��5�
6�
5�s�B,�,
B:c���URn[SS5n[RR	5RU5nSSS5 U"WSS5 U"USS5 U"UR
5S5 URUR55 URUR5[5 URURSS	9[5 g!,(df   N�=f)
NrNrdr�rYr�rZrtTr])
r3r'r�r�r�rDrJr�r�rr_r�rr[s    r:�test_bytes_header_parser�$TestParsers.test_bytes_header_parser8s���
�
�
��
�l�D�
)�R��,�,�0�0�2�8�8��<�C�*�
�3�v�;�-�.�
�3�t�9�m�$�
�3���!�#4�5�����)�)�+�,����c�o�o�/��5����c�o�o�T�o�:�E�B�*�
)�s�.C%�%
C3c�.�[SSS9nUR5nSSS5 [RR	[R
RS9nURWSS9nURUR/5 g!,(df   Np=f)Nz
msg_47.txtr[r�r�T)�headersonly)
r'r�r�r�rr�rVr�r3r)r7r�r�r��
parsed_msgs     r:�%test_header_parser_multipart_is_valid�1TestParsers.test_header_parser_multipart_is_validDsr��
�l�W�
5���g�g�i�G�6����$�$�E�L�L�,@�,@�$�A���_�_�W�$�_�?�
�����+�+�R�0�
6�
5�s�B�
Bc���[SS5n[RR5R	U5 URUR5 SSS5 g!,(df   g=f)NrNrd)r'r�r��BytesParserrDr��closedr�s  r:�%test_bytes_parser_does_not_close_file�1TestParsers.test_bytes_parser_does_not_close_fileNsG��
�l�D�
)�R��L�L�$�$�&�,�,�R�0����R�Y�Y�'�*�
)�
)�s�A	A�
A-c�\�[SS5n[RRnUR	[R
RU"[RRS9RU5 URUR5 SSS5 g!,(df   g=f)N�
msg_15.txtrdr�)r'r�r�rgr�r rir�r�rDr�rh)r7r��bytesParsers   r:�2test_bytes_parser_on_exception_does_not_close_file�>TestParsers.test_bytes_parser_on_exception_does_not_close_fileSsr��
�l�D�
)�R��,�,�2�2�K����e�l�l�F�F�)����1D�1D�E�K�K� �
"�
���R�Y�Y�'�*�
)�
)�s�BB�
B+c���[SSS9n[RR5R	U5 URUR5 SSS5 g!,(df   g=f)NrNr[r�)r'r�r�rrDr�rhr�s  r:�test_parser_does_not_close_file�+TestParsers.test_parser_does_not_close_file[sG��
�l�W�
5���L�L���!�'�'��+����R�Y�Y�'�6�
5�
5�s�A	A�
A+c�X�[SSS9n[RRnUR	[R
RU"[RRS9RU5 URUR5 SSS5 g!,(df   g=f)Nrlr[r�r�)r'r�r�rr�r rir�r�rDr�rh)r7r�r�s   r:�,test_parser_on_exception_does_not_close_file�8TestParsers.test_parser_on_exception_does_not_close_file`sp��
�l�W�
5���\�\�(�(�F����e�l�l�F�F�$�E�L�L�,?�,?�@�F�F��
L����R�Y�Y�'�	6�
5�
5�s�BB�
B)c��URn[R"S5nU"USS5 U"USS5 U"UR5S5 g)Nz�From: aperson@dom.ain
To: bperson@dom.ain
Subject: the next line has a space on it
 
Date: Mon, 8 Apr 2002 15:09:19 -0400
Message-ID: spam

Here's the message body
r��!the next line has a space on it
 r��spam�Here's the message body
�r3r�rr_r6s   r:�test_whitespace_continuation�(TestParsers.test_whitespace_continuationg�V��
�
�
���'�'�	)�	��	�3�y�>�?�@�
�3�|��f�%�
�3�?�?��9�:r=c��URn[R"S5nU"USS5 U"USS5 U"UR5S5 g)Nz�From: aperson@dom.ain
To: bperson@dom.ain
Date: Mon, 8 Apr 2002 15:09:19 -0400
Message-ID: spam
Subject: the next line has a space on it
 

Here's the message body
r�rwr�rxryrzr6s   r:�(test_whitespace_continuation_last_header�4TestParsers.test_whitespace_continuation_last_headeryr}r=c��URn[SSSS9n[5RU5nSSS5 U"[	WR55S5 URS5nU"UR
5S5 U"UR5S5 URS	5nU"UR
5S
5 g!,(df   N�=f)Nr�r[r*r�r�rrAz!Simple email with attachment.

r�zapplication/riscos)r3r'rrDr`r_rJ)r7r8r�r9�part1�part2s      r:�test_crlf_separation� TestParsers.test_crlf_separation�s���
�
�
��
�l�W�d�
C�r��(�.�.��$�C�D�
�3�s��� �!�1�%�����"��
�5�!�!�#�\�2�
�5���� G�H�����"��
�5�!�!�#�%9�:�D�
C�s�C�
Cc�$�[SSSS9nUR5nSSS5 [R"W5n[	5n[U5nUR
USS9 URUR5U5 g!,(df   Nj=f)Nr�r[r*r�r�r�r�r�s      r:�test_crlf_flatten�TestParsers.test_crlf_flatten�sq��
�l�W�d�
C�r��7�7�9�D�D��'�'��-���J���a�L��	�	�	�#�v�	�&��������t�,�
D�
C�s�B�
BNc���URnURn[SSS9n[R"U5nSSS5 U"WR5S5 U"[
UR55S5 URS5nU"UR5S5 U"UR5S5 U"[
UR55S5 URS5nU"UR5S5 U"UR5S5 U"UR5S	5 URS5nU"UR5S5 U"UR5S5 U"[
UR55S5 URS5nU"UR5S5 U"UR5S5 U"UR5S
5 g!,(df   GN�=f)Nr�r[r�r�r�rr�rArr)	r3r�r'r�rr�r`r_rJ)	r7r8rXr�r9r��part1ar��part2as	         r:�-test_multipart_digest_with_extra_mime_headers�9TestParsers.test_multipart_digest_with_extra_mime_headers�s���
�
�
���#�#��
�l�W�
5���)�)�"�-�C�6�	�3����q�!�
�3�s��� �!�1�%�����"��
�5�!�!�#�%5�6�
�5�����#�
�3�u� � �"�#�Q�'��"�"�1�%��
�6��� �!�$�
�6�"�"�$�l�3��F��� �-�0�����"��
�5�!�!�#�%5�6�
�5�����#�
�3�u� � �"�#�Q�'��"�"�1�%��
�6��� �!�$�
�6�"�"�$�l�3��F��� �-�0�56�
5�s�G$�$
G3c��/SQn[R"[RU55nUR	USS5 g)N)z$From: Andrew Person <aperson@dom.ainz
Subject: Testz%Date: Tue, 20 Aug 2002 16:43:45 +1000�datezTue, 20 Aug 2002 16:43:45 +1000)r�rr�r�r3)r7r�r9s   r:�test_three_lines�TestParsers.test_three_lines�s8��:���'�'������7������V��&G�Hr=c���URnSnSnSU<SU<S3n[R"U5nU"URS5U5 U"URS5U5 g)Nr�z	more textzHeader: z
Next-Header: z

Body

rzNext-Header)r3r�r�get)r7r8�value1�value2rr9s      r:�3test_strip_line_feed_and_carriage_return_in_headers�?TestParsers.test_strip_line_feed_and_carriage_return_in_headers�sY��
�
�
�������F�
���'�'��*��
�3�7�7�8��f�%�
�3�7�7�=�!�6�*r=c���URnSn[R"U5nU"[U5S5 U"[	SU55/SQ5 U"UR5S5 g)Nz(>From: foo
From: bar
!"#QUX;~: zoo

bodyr�c3�$# �UHov� M g7frnrZ)r��fields  r:r��9TestParsers.test_rfc2822_header_syntax.<locals>.<genexpr>�s���)�S�E�%�S���)z!"#QUX;~z>Fromr��body)r3r�rr`r�r_r1s    r:�test_rfc2822_header_syntax�&TestParsers.test_rfc2822_header_syntax�sV��
�
�
��:���'�'��*��
�3�s�8�Q��
�6�)�S�)�)�+H�I�
�3�?�?��f�%r=c��URnSn[R"U5nU"[UR	55S5 g)Nz<>From foo@example.com 11:25:53
From: bar
!"#QUX;~: zoo

bodyr)r3r�rr`r�r1s    r:�(test_rfc2822_space_not_allowed_in_header�4TestParsers.test_rfc2822_space_not_allowed_in_header�s6��
�
�
��N���'�'��*��
�3�s�x�x�z�?�A�r=c���URnSn[R"U5nUR5nUR	5 U"U/SQ5 U"UR5S5 g)Nz7A: first header
B: second header
CC: third header

body)�A�B�CCr�)r3r�rr��sortr_)r7r8rr9�headerss     r:�!test_rfc2822_one_character_header�-TestParsers.test_rfc2822_one_character_header�sR��
�
�
��I���'�'��*���(�(�*������
�7�$�%�
�3�?�?��f�%r=c��Sn[R"U5nURURS5R5S5 g)Nz�From: foo@bar.com
To: baz
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary=BOUNDARY

--BOUNDARY
Content-Type: text/plain

body ending with CRLF newline

--BOUNDARY--
rr�)r�rr�r_�r7rr9s   r:�test_CRLFLF_at_end_of_part�&TestParsers.test_CRLFLF_at_end_of_part�s@��

�	
��'�'��*�����C�O�O�A�.�:�:�<�f�Er=rZ)r[r\r]r^r\r_rdrirnrqrtr{rr�r�r;r�r�r�r�r�r�r�r_rZr=r:rWrW+sf��	6�
C�1�(�
(�(�
(�;�$;�$	;�-��G�1�>I�	+�&��&�Fr=rWc	��\rSrSr\R
"S5rSrSrSr	Sr
SrSrS	r
S
rSR\VVVs/sHupUPM	 snnn5S-R!S
5rSrSrSrSrSrSrSrSrSrSrSr\R
"S5R!S
5rSrSr\R
"S5r Sr!Sr"Sr#\ RIS5r%S /\%S!S"&SR\%5r%S#r&\R
"S$5R!S%5r'\R
"S&5r(S'r)S(r*S)r+S*r,S+r-S,r.S-r/S.r0S/r1g.s snnnf)0�Test8BitBytesHandlingi�z�        From: foo@bar.com
        To: baz
        Mime-Version: 1.0
        Content-Type: text/plain; charset={charset}
        Content-Transfer-Encoding: {cte}

        {bodyline}
        c� �URRSSSS9RS5n[R"U5nURUR
5S5 URUR
SS9SRS55 g)Nr[rf�pöstal�rCr��bodyline�pöstal
Tr]��bodytest_msgr8r�r�rr3r_r�s   r:�test_known_8bit_CTE�)Test8BitBytesHandling.test_known_8bit_CTEs������$�$�W�)/�.7�
%�
9�9?����	
��&�&�q�)��������*�K�8���������5�$�+�+�G�4�	6r=c� �URRSSSS9RS5n[R"U5nURUR
5S5 URUR
SS9S	RS55 g)
N�notavalidcharsetrfr�r�r[up��stal
Tr]r�r�r�s   r:�test_unknown_8bit_CTE�+Test8BitBytesHandling.test_unknown_8bit_CTEs������$�$�-?�)/�.7�
%�
9�9?����	
��&�&�q�)��������*�,A�B���������5�$�+�+�G�4�	6r=c� �URRSSSS9RS5n[R"U5nURUR
5S5 URUR
SS9SRS55 g)	Nr[rE�p=C3=B6stálr�u
p=C3=B6stál
Tr]�	pöstál
r�r�s   r:�test_8bit_in_quopri_body�.Test8BitBytesHandling.test_8bit_in_quopri_body$s���
���$�$�W�);�.<�
%�
>�>D�f�W�o�	
��&�&�q�)��������*�,<�=���������5�%�,�,�W�5�	7r=c� �URRSSSS9RS5n[R"U5nURUR
5S5 URUR
SS9S	RS55 g)
Nr�rEr�r�r[up=C3=B6st��l
Tr]r�r�r�s   r:�.test_invalid_8bit_in_non_8bit_cte_uses_replace�DTest8BitBytesHandling.test_invalid_8bit_in_non_8bit_cte_uses_replace6s���
���$�$�W�);�.<�
%�
>�>D�f�W�o�	
��&�&�q�)��������*�,F�G���������5�$�+�+�G�4�	6r=c�:�URRSSSS9RS5n[R"U5nURUR
SS9SRS55 URURS[R5 g)	Nr[r\u
cMO2c3RhbAá=r�Tr]r�r)r�r8r�r�rr3r_rrr r
r�s   r:�test_8bit_in_base64_body�.Test8BitBytesHandling.test_8bit_in_base64_bodyFs���
���$�$�W�)1�.=�
%�
?�?E�v�g��	
��&�&�q�)����������5�"�)�)�'�2�	4����c�k�k�!�n�$�B�B�	Dr=c���URRSSSS9RS5n[R"U5nURUR
SS9SRS55 g)Nr[r�u
<,.V<W1A; á r�Tr]u<,.V<W1A; á 
r�r�s   r:�test_8bit_in_uuencode_body�0Test8BitBytesHandling.test_8bit_in_uuencode_bodySsn��
���$�$�W�)3�.=�
%�
?�?E�v�g��	
��&�&�q�)����������5�*�1�1�'�:�	<r=c��[R"S5RS5n[R"U5nURUR
5S5 URUR
SS9SRS55 g)Nu�        From: foo@bar.com
        To: baz
        Mime-Version: 1.0
        Content-Type: text/plain; charset*=ansi-x3.4-1968''utf-8
        Content-Transfer-Encoding: 8bit

        pöstal
        r[r�Tr])r�r�r�r�rr3r_r�s   r:�test_rfc2231_charset_8bit_CTE�3Test8BitBytesHandling.test_rfc2231_charset_8bit_CTE]su���O�O��

��V�G�_�	
��&�&�q�)��������*�K�8���������5�$�+�+�G�4�	6r=))zFrom: foo@bar.com�r�r�)uTo: báz)r�z=?unknown-8bit?q?b=C3=A1z?=)uVSubject: Maintenant je vous présente mon collègue, le pouf célèbre
	Jean de Baddie)rKz�=?unknown-8bit?q?Maintenant_je_vous_pr=C3=A9sente_mon_coll=C3=A8gue=2C_le_pouf_c=C3=A9l=C3=A8bre?=
 =?unknown-8bit?q?_Jean_de_Baddie?=)uFrom: göst)r�z=?unknown-8bit?b?Z8O2c3Q=?=r*z
Yes, they are flying.
r[c���[R"UR5nUR[	URS55S5 UR[	US5S5 g)Nr��b��z)r�r�headertest_msgr3r�r�rps  r:�test_get_8bit_header�*Test8BitBytesHandling.test_get_8bit_headerzsO���&�&�t�':�':�;������S�W�W�T�]�+�-=�>�����S��Y��)9�:r=c��[R"UR5nUR[	U5[
R"S5R"URVVs/sH
up#USPM snn65 gs snnf)Nz�                            From: {}
                            To: {}
                            Subject: {}
                            From: {}

                            Yes, they are flying.
                            r�)	r�rr�r3r�r�r�r8�headertest_headers)r7r9�_rs    r:�test_print_8bit_headers�-Test8BitBytesHandling.test_print_8bit_headerss����&�&�t�':�':�;������S��!���* �!�"(��(�)-�(?�(?�*A�(?�;H�1�(�1�+�(?�*A�B�		C��*As�%Bc���[R"UR5nURUR	5Vs/sHn[U5PM sn/SQ5 gs snf)N)r�r��]Maintenant je vous pr��sente mon coll��gue, le pouf c��l��bre
	Jean de Baddie�	g��st)r�rr��assertListEqualr�r��r7r9rs   r:�test_values_with_8bit_headers�3Test8BitBytesHandling.test_values_with_8bit_headers�sI���&�&�t�':�':�;�����c�j�j�l�;�l��c�!�f�l�;�2�	3��;s�Ac
���[R"UR5nURUR	5VVs/sHup#[U5[U54PM snn/SQ5 gs snnf)N)r�)r�r�)rKr�)r�r�)r�rr�r�r�r�)r7r9rrLs    r:�test_items_with_8bit_headers�2Test8BitBytesHandling.test_items_with_8bit_headers�sT���&�&�t�':�':�;�����S�Y�Y�[�I�[�6�A�s�1�v�s�1�v�.�[�I�<�	=��Is�"A-
c���[R"UR5nURUR	S5Vs/sHn[U5PM snSS/5 gs snf)Nr�r�r�)r�rr�r�r5r�r�s   r:�test_get_all_with_8bit_headers�4Test8BitBytesHandling.test_get_all_with_8bit_headers�sT���&�&�t�':�':�;�����c�k�k�&�.A�B�.A��c�!�f�.A�B�,�0�2�	3��Bs�Ac�6�[R"[R"S5R	S55nURUR
5S5 URUR5S5 URUR5S5 g)NuA            Content-Type: text/pl§in; charset=utf-8
            r-utext/pl�inr�upl�in)	r�rr�r�r�r3rJr�r�rps  r:�test_get_content_type_with_8bit�5Test8BitBytesHandling.test_get_content_type_with_8bit�sz���&�&�x���8�(���	�"�$��	
����-�-�/�1B�C�����1�1�3�V�<�����0�0�2�L�Ar=c��[R"SRS55nURUR	SS9/SQ5 URURSSS9S5 URURSSS9S5 g)	Nu(X-Header: foo=§ne; b§r=two; baz=three
r-r6r7))r���ne)ub�rr:r;�Foor�ub§r)r�rr�r3r>rKrps  r:�test_get_params_with_8bit�/Test8BitBytesHandling.test_get_params_with_8bit�sz���&�&�;�B�B�9�M�O��������z��:�G�	I�������u�Z��@�*�M�������x�
��C�T�Jr=c��[R"[R"S5R	S55nURUR
S5S5 g)N�n            Content-Type: text/plain; charset=us-ascii;
             title*=us-ascii'en'This%20is%20not%20f§nr-�title)rQ�enuThis is not f�n)r�rr�r�r�r3rKrps  r:�!test_get_rfc2231_params_with_8bit�7Test8BitBytesHandling.test_get_rfc2231_params_with_8bit�sL���&�&�x���8<�(��v�i� �"��	
������w�/�6�	8r=c���[R"[R"S5R	S55nURSS5 UR
URS5S5 g)Nr�r-r��test)r�rr�r�r�rsr3rKrps  r:�!test_set_rfc2231_params_with_8bit�7Test8BitBytesHandling.test_set_rfc2231_params_with_8bit�sW���&�&�x���8<�(��v�i� �"��	�
�
�g�v�&�������w�/��8r=c��[R"[R"S5R	S55nURS5 UR
URS5S5 UR
UR5S5 g)Nr�r-r�r�)	r�rr�r�r�r~r3rKr�rps  r:�!test_del_rfc2231_params_with_8bit�7Test8BitBytesHandling.test_del_rfc2231_params_with_8bit�sn���&�&�x���8<�(��v�i� �"��	�
�
�g��������w�/��6�����1�1�3�V�<r=c���[R"[R"S5R	S55nURUR
5S5 URUR
SS9S5 g)Nu�            Content-Transfer-Encoding: b§se64
            Content-Type: text/plain; charset=latin-1

            payload
            r-zpayload
Tr]spayload
)r�rr�r�r�r3r_rps  r:�%test_get_payload_with_8bit_cte_header�;Test8BitBytesHandling.test_get_payload_with_8bit_cte_header�sb���&�&�x���8�(�
��	�"�$��	
������*�K�8���������5�|�Dr=u0        From: foo@bar.com
        To: báz
        Subject: Maintenant je vous présente mon collègue, le pouf célèbre
        	Jean de Baddie
        Mime-Version: 1.0
        Content-Type: text/plain; charset="utf-8"
        Content-Transfer-Encoding: 8bit

        Да, они летят.
        c��[R"UR5n[5n[RRU5R
U5 URUR5UR5 grn)	r�r�non_latin_bin_msgrr�r
r�r3r��r7r9r�s   r:�test_bytes_generator�*Test8BitBytesHandling.test_bytes_generator�sX���&�&�t�'=�'=�>���i��
���&�&�s�+�3�3�C�8���������)?�)?�@r=c���[RR5n[5n[RRU5R
U5 URUR5S5 g)Nr)	r�r^rrr�r
r�r3r�rs   r:�&test_bytes_generator_handles_None_body�<Test8BitBytesHandling.test_bytes_generator_handles_None_body�sN���m�m�#�#�%���i��
���&�&�s�+�3�3�C�8���������/r=a�        From: foo@bar.com
        To: =?unknown-8bit?q?b=C3=A1z?=
        Subject: =?unknown-8bit?q?Maintenant_je_vous_pr=C3=A9sente_mon_coll=C3=A8gue?=
         =?unknown-8bit?q?=2C_le_pouf_c=C3=A9l=C3=A8bre?=
         =?unknown-8bit?q?_Jean_de_Baddie?=
        Mime-Version: 1.0
        Content-Type: text/plain; charset="utf-8"
        Content-Transfer-Encoding: base64

        0JTQsCwg0L7QvdC4INC70LXRgtGP0YIuCg==
        c��[R"UR5n[5n[RRU5R
U5 URUR5UR5 grn)
r�rrrr�rr�r3r�� non_latin_bin_msg_as7bit_wrappedrs   r:�test_generator_handles_8bit�1Test8BitBytesHandling.test_generator_handles_8bitsX���&�&�t�'=�'=�>���j��
���!�!�#�&�.�.�s�3���������)N�)N�Or=c�x�[R"UR5n[5n[	U5RU5 UR
5n[[55RU5 [5n[	U5RU5 URUR
5U5 grn)
r�rrrr
r�r�rrr3)r7r9r��
orig_values    r:�;test_str_generator_should_not_mutate_msg_when_handling_8bit�QTest8BitBytesHandling.test_str_generator_should_not_mutate_msg_when_handling_8bits����&�&�t�'=�'=�>���i���s��#�#�C�(��\�\�^�
��(�*��%�%�c�*��i���s��#�#�C�(���������4r=c��[R"UR5n[5n[RRU5R
USS9 UR5RS5nURUSR5SS5 URSRUSS5UR5 g)NTr�rrsFromr�)r�rrrr�r
r�r�r�r3r�)r7r9r�r�s    r:�#test_bytes_generator_with_unix_from�9Test8BitBytesHandling.test_bytes_generator_with_unix_froms����&�&�t�'=�'=�>���i��
���&�&�s�+�3�3�C�$�3�G�����$�$�U�+������q����)�!�,�g�6�������E�!�"�I�.��0F�0F�Gr=zkSubject: =?unknown-8bit?q?Maintenant_je_vous_pr=C3=A9sente_mon_coll=C3=A8gue=2C_le_pouf_c=C3=A9l=C3=A8bre?=r�r�c��SnUR[U5 [US5nURUR5 SSS5 [US5n[
RR5RU5nSSS5 UR[W5UR5 g!,(df   Nv=f!,(df   NE=f)Nztest.msg�wbrd)�
addCleanupr&�open�writerr�r�rgrDr3r��non_latin_bin_msg_as7bit)r7r�testfilers    r:�test_message_from_binary_file�3Test8BitBytesHandling.test_message_from_binary_file&s���
�������#�
�"�d�^�x��N�N�4�1�1�2��
�"�d�^�x����(�(�*�0�0��:�A������Q���!>�!>�?�	�^��
�^�s�B1�.C�1
B?�
Cu        From: foo@bar.com
        To: Dinsdale
        Subject: Nudge nudge, wink, wink
        Mime-Version: 1.0
        Content-Type: text/plain; charset="latin-1"
        Content-Transfer-Encoding: 8bit

        oh là là, know what I mean, know what I mean?
        r-a         From: foo@bar.com
        To: Dinsdale
        Subject: Nudge nudge, wink, wink
        Mime-Version: 1.0
        Content-Type: text/plain; charset="iso-8859-1"
        Content-Transfer-Encoding: quoted-printable

        oh l=E0 l=E0, know what I mean, know what I mean?
        c��[R"UR5nUR[	U5UR
5 grn)r�r�
latin_bin_msgr3r��latin_bin_msg_as7bitrMs  r:�:test_string_generator_reencodes_to_quopri_when_appropriate�PTest8BitBytesHandling.test_string_generator_reencodes_to_quopri_when_appropriateEs2���$�$�T�%7�%7�8������Q���!:�!:�;r=c�,�[R"UR5n[5n[RRU5R
U5 URUR5URRS5S-5 g)Nr-r*)
r�rrrr�rr�r3r�r^)r7rr�s   r:�)test_decoded_generator_emits_unicode_body�?Test8BitBytesHandling.test_decoded_generator_emits_unicode_bodyIsm���$�$�T�%7�%7�8���j��
���(�(��-�5�5�a�8�	
����������%�%�i�0��5�	7r=c�8�[RR5n[S[	UR
5S5H#nUR
UR
X"S-5 M% UR5nUR[U5UR5 g)Nrr�)r�r��BytesFeedParserr�r`rrArBr3r�r)r7�bfpr�rs    r:�test_bytes_feedparser�+Test8BitBytesHandling.test_bytes_feedparserSst�����.�.�0���q�#�d�0�0�1�2�6�A��H�H�T�'�'��B�$�/�0�7��I�I�K������Q���!:�!:�;r=c�N�[SS5nUR5nSSS5 [R"W5n[	5n[R
R
U5nURUSS9 URUR5U5 g!,(df   N~=f)Nr�rdr�r�)
r'r�r�rrr�r
r�r3r�r�s      r:r��'Test8BitBytesHandling.test_crlf_flattenZsx��
�l�D�
)�R��7�7�9�D�*��&�&�t�,���I���O�O�*�*�1�-��	�	�	�#�v�	�&��������t�,�
*�
)�s�B�
B$c�.�[R"S5RS5n[R"U5n[5n[RRU5nURU5 URUR5U5 g)Nuo            Date: Fri, 18 Mar 2011 17:15:43 +0100
            To: foo@example.com
            From: foodwatch-Newsletter <bar@example.com>
            Subject: Aktuelles zu Japan, Klonfleisch und Smiley-System
            Message-ID: <76a486bee62b0d200f33dc2ca08220ad@localhost.localdomain>
            MIME-Version: 1.0
            Content-Type: multipart/alternative;
                    boundary="b1_76a486bee62b0d200f33dc2ca08220ad"

            --b1_76a486bee62b0d200f33dc2ca08220ad
            Content-Type: text/plain; charset="utf-8"
            Content-Transfer-Encoding: 8bit

            Guten Tag, ,

            mit großer Betroffenheit verfolgen auch wir im foodwatch-Team die
            Nachrichten aus Japan.


            --b1_76a486bee62b0d200f33dc2ca08220ad
            Content-Type: text/html; charset="utf-8"
            Content-Transfer-Encoding: 8bit

            <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
                "http://www.w3.org/TR/html4/loose.dtd">
            <html lang="de">
            <head>
                    <title>foodwatch - Newsletter</title>
            </head>
            <body>
              <p>mit gro&szlig;er Betroffenheit verfolgen auch wir im foodwatch-Team
                 die Nachrichten aus Japan.</p>
            </body>
            </html>
            --b1_76a486bee62b0d200f33dc2ca08220ad--

            r[)r�r�r�r�rrr�r
r�r3r�)r7rr9r�r�s     r:�test_8bit_multipart�)Test8BitBytesHandling.test_8bit_multipartcst�����%"�%�J����K	�L�&�&�v�.���I���O�O�*�*�1�-��	�	�	�#���������v�.r=c���[5n[S5US'[5n[RRU5nUR
USS9 URUR5S5 g)N�žluťoučký kůňrKr�r�s5Subject: =?utf-8?b?xb5sdcWlb3XEjWvDvSBrxa/FiA==?=

)	rrrr�r�r
r�r3r��r7rr�r�s    r:�'test_bytes_generator_b_encoding_linesep�=Test8BitBytesHandling.test_bytes_generator_b_encoding_linesep�s^���I���3�4��)���I���O�O�*�*�1�-��	�	�	�!�V�	�$����
�J�J�L�H�	Jr=c���[5n[S5US'[5n[RRU5nUR
USS9 URUR5S5 g)Nr.rKr�r�z5Subject: =?utf-8?b?xb5sdcWlb3XEjWvDvSBrxa/FiA==?=

)	rrrr�r�rr�r3r�r/s    r:�!test_generator_b_encoding_linesep�7Test8BitBytesHandling.test_generator_b_encoding_linesep�s^���I���3�4��)���J���O�O�%�%�a�(��	�	�	�!�V�	�$����
�J�J�L�G�	Ir=NrZ)2r[r\r]r^r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrr	r
rr�rrrrrr!r&r�r+r0r3r;r_)r�rbr�s000r:r�r��s����?�?�$�
�L�6�6�7�$
6� D�<�
6� 	
���i�i�5G� H�5G��#��5G� H�I�#�$�%+�V�G�_��;�
C�	3�
=�3�B�K�8�9�=�E�!���
)�

��V�G�_��A�0�(0���8�(
�$�P�5�	H� @�E�E�d�K��	8�%9��Q�q�!� $�y�y�)A�B��@��O�O�	%�	
��V�I�
��$�?�?�	,�	
��<�7�<�-�,/�\
J�
I��G��e	!Is�Er�c�(�\rSrSrSrSrSSjrSrg)� BaseTestBytesGeneratorIdempotenti�Nc���[US5nUR5nSSS5 URRURW5n[
R"U5nXC4$!,(df   NM=f)Nrd)r'r��normalize_linesep_regex�sub�blinesepr�rr;s     r:r4�(BaseTestBytesGeneratorIdempotent._msgobj�s[��
�h��
%���7�7�9�D�&��+�+�/�/��
�
�t�D���&�&�t�,���y��	&�
%�s�A%�%
A3c���[5n[RRUSS9nUR	XUR
S9 UR
X$R55 g)Nrr	)r�r�)rr�r�r
r�r�r3r�)r7r9rar�rQr�s      r:r>�,BaseTestBytesGeneratorIdempotent._idempotent�sJ���I���O�O�*�*�1�1�*�=��	�	�	�#�$�,�,�	�?�����z�z�|�,r=rZr�)r[r\r]r^r;r4r>r_rZr=r:r6r6�s���G��-r=r6c�@�\rSrSrSrSr\R"S5rSr	g)�TestBytesGeneratorIdempotentNLi�r*rs\r\nrZN�
r[r\r]r^r�r:�re�compiler8r_rZr=r:r?r?�s���G��H� �j�j��2�r=r?c�@�\rSrSrSrSr\R"S5rSr	g)� TestBytesGeneratorIdempotentCRLFi�r�r�s	(?<!\r)\nrZNr@rZr=r:rDrD�s���G��H� �j�j��7�r=rDc�,�\rSrSrSrSrSrSrSrg)�
TestBase64i�c
�P�URnU"[R"S5[[R"SSS955 [S5HRnUS:XaSnO&US::aSnOUS	::aS
nOUS::aSnOUS::aS
nOSnU"[R"SU-5U5 MT g)N�hello�hellor+��eol�rr�r�r�r�r�r��r)r3r�
header_lengthr`�body_encoder�)r7r8�size�bsizes    r:�test_len�TestBase64.test_len�s���
�
�
��
�:�#�#�G�,��z�%�%�h�B�7�8�	:��"�I�D����Q�U����Q�U����Q�U����R�U����R�U�%'�U��z�'�'��d�
�3�U�;�r=c��URnU"[R"S5S5 U"[R"S5S5 g)Nr+r=zaGVsbG8=rI)r3rr^r�s  r:�test_decode�TestBase64.test_decode�s7��
�
�
��
�:���R� �#�&�
�:���Z�(�(�3r=c�<�URnU"[R"S5S5 U"[R"S5S5 U"[R"S5S5 U"[R"SSS	9S
5 U"[R"SSSS9S
5 g)Nr=r+rIz	aGVsbG8=
shello
z	aGVsbG8K
sdxxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx �(r�z�eHh4eCB4eHh4IHh4eHggeHh4eCB4eHh4IHh4eHgg
eHh4eCB4eHh4IHh4eHggeHh4eCB4eHh4IHh4eHgg
eHh4eCB4eHh4IHh4eHggeHh4eCB4eHh4IHh4eHgg
eHh4eCB4eHh4IA==
r��r�rKz�eHh4eCB4eHh4IHh4eHggeHh4eCB4eHh4IHh4eHgg
eHh4eCB4eHh4IHh4eHggeHh4eCB4eHh4IHh4eHgg
eHh4eCB4eHh4IHh4eHggeHh4eCB4eHh4IHh4eHgg
eHh4eCB4eHh4IA==
)r3rrPr�s  r:�test_encode�TestBase64.test_encode�s���
�
�
��
�:�!�!�#�&��+�
�:�!�!�(�+�\�:�
�:�!�!�*�-�|�<�
�:�!�!�-�B�?�B�	�	�:�!�!�-�B�F�K��	r=c���URn[RnU"U"S5S5 U"U"S5S5 U"U"S5S5 U"U"SSS9S	5 U"U"S5S5 g)
NrHz=?iso-8859-1?b?aGVsbG8=?=�hello
worldz!=?iso-8859-1?b?aGVsbG8NCndvcmxk?=�hello
worldz!=?iso-8859-1?b?aGVsbG8Kd29ybGQ=?=r|r�z=?iso-8859-2?b?aGVsbG8=?=)r3rr7)r7r8�hes   r:�test_header_encode�TestBase64.test_header_encode�sj��
�
�
��
�
%�
%��
�2�g�;�3�4�
�2���!D�E�
�2�n��B�C�
�2�g�|�,�.I�J�
�2�n��B�Cr=rZN)	r[r\r]r^rSrVr[rar_rZr=r:rFrF�s��<�4�
�,Dr=rFc��\rSrSrSrSrSrSrSrSr	SGS	jr
S
rSrSr
S
rSrSrSrSrSrSrSrSGSjrSrSrSrSrSrSrSrSrSrSr S r!S!r"S"r#S#r$S$r%S%r&S&r'S'r(S(r)S)r*S*r+S+r,S,r-SHS-jr.S.r/S/r0S0r1S1r2S2r3S3r4S4r5S5r6S6r7S7r8S8r9S9r:S:r;S;r<S<r=S=r>S>r?S?r@S@rASArBSBrCSCrDSDrESErFSFrGg)I�
TestQuopriic���[[[[S5[S5S-5[[S5[S5S-5[[S5[S5S-5SS	555Ul[S
5Vs/sHoUR;dMUPM snUl[[[S5[S5S-55UlURR[S
55 URR[S55 [S
5Vs/sHoUR;dMUPM snUl	gs snfs snf)Nr��zr�r��Zr��9c3�$# �UHov� M g7frnrZ)r�r�s  r:r��#TestQuopri.setUp.<locals>.<genexpr>s���!��1�Q��r�s!*+-/�r,�~r��=)
r�rr��ord�hlit�hnon�blitr��remove�bnon�r7r�s  r:r@�TestQuopri.setUps�����#�c�(�C��H�q�L�)��#�c�(�C��H�q�L�)��#�c�(�C��H�q�L�)�!��!�	#�$��	�!&�c�
�A�
�1�t�y�y�.@�Q�
�A��	���s�3�x��S��A��6�7��	��	�	����T��#��	�	����S��"�!&�c�
�A�
�1�t�y�y�.@�Q�
�A��	��B��Bs�E�%E�7E"�E"c��URH5nUR[R"U5S[	U5-5 M7 UR
H5nUR
[R"U5S[	U5-5 M7 g)Nz'Should not be header quopri encoded: %sz#Should be header quopri encoded: %s)ror�r"�header_check�chrrprrts  r:�test_quopri_header_check�#TestQuopri.test_quopri_header_checksn�����A����Z�4�4�Q�7�A�C��F�J�
L�����A��O�O�J�3�3�A�6�A�C��F�J�
L�r=c��URH5nUR[R"U5S[	U5-5 M7 UR
H5nUR
[R"U5S[	U5-5 M7 g)Nz%Should not be body quopri encoded: %sz!Should be body quopri encoded: %s)rqr�r"�
body_checkrxrsrrts  r:�test_quopri_body_check�!TestQuopri.test_quopri_body_checksn�����A����Z�2�2�1�5�?�#�a�&�H�
J�����A��O�O�J�1�1�!�4�?�#�a�&�H�
J�r=c	��URnU"[R"S5S5 U"[[R"SSS95[R"S5S-5 U"[R"S5S5 U"[[R"SSS95[R"S5S-5 UR
H7nU"[R"[
U/55SS	[U5-5 M9 URHHnU[S
5:XaMU"[R"[
U/55SS[U5-5 MJ U"[R"S
5S5 g)NrIr��xxxr�r�s
h@e@l@l@o@rNr�zexpected length 1 for %rr,r�zexpected length 3 for %r� )
r3r"rOr`r7rorrxrprn�r7r8r�s   r:�test_header_quopri_len�!TestQuopri.test_header_quopri_len's4��
�
�
��
�:�#�#�H�-�q�1�
�3�z�'�'��%�@�A��#�#�H�-�
��	�	�:�#�#�M�2�B�7�
�3�z�'�'�
�u�E�F��#�#�M�2�
��	����A��z�'�'��q�c�
�3�Q�)�C��F�2�
4�����A��C��H�}���z�'�'��q�c�
�3�Q�)�C��F�2�
4�	�	�:�#�#�D�)�1�-r=c��URnURH*nU"[R"[	U/55S5 M, UR
H*nU"[R"[	U/55S5 M, g)Nr�r�)r3rqr"�body_lengthrrsr�s   r:�test_body_quopri_len�TestQuopri.test_body_quopri_len@s_��
�
�
�����A��z�%�%�e�Q�C�j�1�1�5�����A��z�%�%�e�Q�C�j�1�1�5�r=c��[S5HHn[U5nUR[R"[R
"U55U5 MJ g)Nrk)r�rxr3r"rQ�quote)r7rr�s   r:�test_quote_unquote_idempotent�(TestQuopri.test_quote_unquote_idempotentGs?���s��A��A��A����Z�/�/�
�0@�0@��0C�D�a�H�r=Nc��Uc[R"U5nO[R"X5nURXB5 grn)r"r7r3)r7r��expected_encoded_headerrC�encoded_headers     r:�_test_header_encode�TestQuopri._test_header_encodeLs5���?�'�5�5�f�=�N�'�5�5�f�F�N�����Ar=c�(�URSS5 g)Nr=r+�r�r?s r:�test_header_encode_null�"TestQuopri.test_header_encode_nullSs��� � ��b�)r=c�(�URSS5 g)NrIz=?iso-8859-1?q?hello?=r�r?s r:�test_header_encode_one_word�&TestQuopri.test_header_encode_one_wordVs��� � ��+C�Dr=c�(�URSS5 g)Nshello
worldz=?iso-8859-1?q?hello=0Aworld?=r�r?s r:�test_header_encode_two_lines�'TestQuopri.test_header_encode_two_linesYs��� � �� @�	Br=c�(�URSS5 g)Nshello�therez=?iso-8859-1?q?hello=C7there?=r�r?s r:�test_header_encode_non_ascii�'TestQuopri.test_header_encode_non_ascii]s��� � �!2� @�	Br=c�&�URSSSS9 g)NrIz=?iso-8859-2?q?hello?=r|r�r�r?s r:�test_header_encode_alt_charset�)TestQuopri.test_header_encode_alt_charsetas��� � ��+C�$�	!�	&r=c�R�[R"U5nURX25 grn)r"�
header_decoder3)r7r��expected_decoded_header�decoded_headers    r:�_test_header_decode�TestQuopri._test_header_decodees ��#�1�1�.�A������Ar=c�(�URSS5 g�Nr+�r�r?s r:�test_header_decode_null�"TestQuopri.test_header_decode_nullis��� � ��R�(r=c�(�URSS5 g�NrHr�r?s r:�test_header_decode_one_word�&TestQuopri.test_header_decode_one_wordls��� � ��'�2r=c�(�URSS5 g)Nz
hello=0Aworldr_r�r?s r:�test_header_decode_two_lines�'TestQuopri.test_header_decode_two_linesos��� � ��.�Ar=c�(�URSS5 g)Nz
hello=C7thereuhelloÇtherer�r?s r:�test_header_decode_non_ascii�'TestQuopri.test_header_decode_non_asciirs��� � ��2B�Cr=c�P�UR[R"S5S5 g)Na=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30=30�00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)r3r"r�r?s r:�test_header_decode_re_bug_18380�*TestQuopri.test_header_decode_re_bug_18380us������1�1�+�>�	�Jr=c��Uc[R"U5nO[R"XS9nURXB5 g)NrJ)r"r^r3)r7�encoded�expected_decodedrK�decodeds     r:�_test_decode�TestQuopri._test_decodeys5���;� �'�'��0�G� �'�'��9�G�����3r=c�(�URSS5 gr��r�r?s r:�test_decode_null_word� TestQuopri.test_decode_null_word�������"�b�!r=c�(�URSS5 g)Nr�r*r�r?s r:�test_decode_null_line_null_word�*TestQuopri.test_decode_null_line_null_word�s�����&�$�'r=c�(�URSS5 gr�r�r?s r:�test_decode_one_word�TestQuopri.test_decode_one_word�s�����'�7�+r=c�&�URSSSS9 g)NrH�XrJr�r?s r:�test_decode_one_word_eol�#TestQuopri.test_decode_one_word_eol�s�����'�7���4r=c�(�URSS5 g�N�hello
�hello
r�r?s r:�test_decode_one_line�TestQuopri.test_decode_one_line�������+�y�1r=c�(�URSS5 g�Nr�r�r?s r:�test_decode_one_line_lf�"TestQuopri.test_decode_one_line_lf�������)�Y�/r=c�(�URSS5 g)Nzhello
r�r�r?s r:�test_decode_one_line_cr�"TestQuopri.test_decode_one_line_cr�r�r=c�&�URSSSS9 g)Nr��helloXr�rJr�r?s r:�test_decode_one_line_nl�"TestQuopri.test_decode_one_line_nl�s�����)�X�3��7r=c�&�URSSSS9 g)Nr�r�r�rJr�r?s r:�test_decode_one_line_crnl�$TestQuopri.test_decode_one_line_crnl�s�����+�x�S��9r=c�(�URSS5 g)Nr^r_r�r?s r:�test_decode_one_line_one_word�(TestQuopri.test_decode_one_line_one_word�s�����*�N�;r=c�&�URSSSS9 g)Nr^�helloXworldr�rJr�r?s r:�!test_decode_one_line_one_word_eol�,TestQuopri.test_decode_one_line_one_word_eol�s�����*�M�s��Cr=c�(�URSS5 g)N�hello
world
�hello
world
r�r?s r:�test_decode_two_lines� TestQuopri.test_decode_two_lines�s�����.�0@�Ar=c�&�URSSSS9 g)Nr��helloXworldXr�rJr�r?s r:�test_decode_two_lines_eol�$TestQuopri.test_decode_two_lines_eol�s�����.��C��Hr=c�(�URSS5 g)N��SpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamSpamr�r?s r:�test_decode_one_long_line�$TestQuopri.test_decode_one_long_line�s�����,��5r=c�(�URSS5 g)Nr,r+r�r?s r:�test_decode_one_space� TestQuopri.test_decode_one_space�s�����#�r�"r=c�(�URSS5 g)Nz     r+r�r?s r:�test_decode_multiple_spaces�&TestQuopri.test_decode_multiple_spaces�s�����'�2�&r=c�(�URSS5 g)Nzhello    
r�r�r?s r:�$test_decode_one_line_trailing_spaces�/TestQuopri.test_decode_one_line_trailing_spaces�s�����/�9�5r=c�(�URSS5 g)Nzhello    
world   
r�r�r?s r:�%test_decode_two_lines_trailing_spaces�0TestQuopri.test_decode_two_lines_trailing_spaces�s�����5�7G�Hr=c�(�URSS5 g)Nz=22quoted=20words=22z"quoted words"r�r?s r:�test_decode_quoted_word�"TestQuopri.test_decode_quoted_word�s�����0�2B�Cr=c�(�URSS5 g)Nzab=CD=EF�abÍïr�r?s r:�test_decode_uppercase_quoting�(TestQuopri.test_decode_uppercase_quoting�������*�l�3r=c�(�URSS5 g)Nzab=cd=efr
	r�r?s r:�test_decode_lowercase_quoting�(TestQuopri.test_decode_lowercase_quoting�r
	r=c�(�URSS5 g)Nzsoft line=
breakzsoft linebreakr�r?s r:�test_decode_soft_line_break�&TestQuopri.test_decode_soft_line_break�s�����/�1A�Br=c�(�URSS5 g)NzA=1,B=A ==> A+B==2r�r?s r:�test_decode_false_quoting�$TestQuopri.test_decode_false_quoting�s�����.�0D�Er=c��0nUcSnOX5S'UcSnOXES'[R"U40UD6nURXb5 US:XdUS:Xa3UR5HnUR	[U5U5 M  gg)Nrer�r*rKr�)r"rPr3r�rhr`)r7r��expected_encoded_bodyr�rK�kwargs�encoded_body�lines        r:�_test_encode�TestQuopri._test_encode�s��������J�#-�<� ��;��C��5�M�!�-�-�d�=�f�=������=��$�;�#��-�%�/�/�1���$�$�S��Y�
�;�2�(r=c�(�URSS5 gr��r	r?s r:�test_encode_null�TestQuopri.test_encode_null�r�r=c�(�URSS5 g)Nz

r	r?s r:�test_encode_null_lines�!TestQuopri.test_encode_null_lines�s�����&�&�)r=c�(�URSS5 gr�r	r?s r:�test_encode_one_line�TestQuopri.test_encode_one_line�r�r=c�(�URSS5 gr�r	r?s r:�test_encode_one_line_crlf�$TestQuopri.test_encode_one_line_crlf�r�r=c�&�URSSSS9 g)Nr�r�r�rJr	r?s r:�test_encode_one_line_eol�#TestQuopri.test_encode_one_line_eol�s�����)�[�f��=r=c�b�URSRS5RS5SSS9 g)Nuhelloυ
r[�latin1z
hello=CF=85
r�rJ)r	r�r^r?s r:�(test_encode_one_line_eol_after_non_ascii�3TestQuopri.test_encode_one_line_eol_after_non_ascii�s2�����/�0�0��9�@�@��J�+��	�	9r=c�(�URSS5 g)Nr,z=20r	r?s r:�test_encode_one_space� TestQuopri.test_encode_one_space�s�����#�u�%r=c�(�URSS5 g)Nz 
z=20
r	r?s r:�test_encode_one_line_one_space�)TestQuopri.test_encode_one_line_one_space�s�����%��)r=c�(�URSS5 g)Nz 
 
z=20
=20
r	r?s r:�test_encode_two_lines_one_space�*TestQuopri.test_encode_two_lines_one_space�s�����(�L�1r=c�(�URSS5 g)Nzhello   z
hello  =20r	r?s r:�$test_encode_one_word_trailing_spaces�/TestQuopri.test_encode_one_word_trailing_spaces�r
	r=c�(�URSS5 g)Nz	hello   
zhello  =20
r	r?s r:�$test_encode_one_line_trailing_spaces�/TestQuopri.test_encode_one_line_trailing_spaces�s�����,��7r=c�(�URSS5 g)Nzhello  	z
hello  =09r	r?s r:�!test_encode_one_word_trailing_tab�,TestQuopri.test_encode_one_word_trailing_tabs�����+�|�4r=c�(�URSS5 g)Nz	hello  	
zhello  =09
r	r?s r:�!test_encode_one_line_trailing_tab�,TestQuopri.test_encode_one_line_trailing_tabs�����-��8r=c�&�URSSSS9 g)N�
abcd 
1234zabcd =

1234r�r�r	r?s r:�,test_encode_trailing_space_before_maxlinelen�7TestQuopri.test_encode_trailing_space_before_maxlinelens�����-�)9�a��Hr=c�&�URSSSS9 g)NrH	zabcd=
=20
1234r�r�r	r?s r:�(test_encode_trailing_space_at_maxlinelen�3TestQuopri.test_encode_trailing_space_at_maxlinelen
������-�);���Jr=c�&�URSSSS9 g)NrH	zabc=
d=20
1234r�r�r	r?s r:�,test_encode_trailing_space_beyond_maxlinelen�7TestQuopri.test_encode_trailing_space_beyond_maxlinelen
rN	r=c�(�URSS5 g)Nz
 
 
 
 
 
z=20
=20
=20
=20
=20
r	r?s r:�test_encode_whitespace_lines�'TestQuopri.test_encode_whitespace_liness�����)�[�1r=c�(�URSS5 g)Nza = bza =3D br	r?s r:�test_encode_quoted_equals�$TestQuopri.test_encode_quoted_equalss�����'�9�-r=c�(�URSS5 g)N�dxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxzfxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
xxxxxxxxxxxxxxxxxxxxxxxxxr	r?s r:�test_encode_one_long_string�&TestQuopri.test_encode_one_long_strings�����)�%@�Ar=c�(�URSS5 g)Nzexxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
zgxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
xxxxxxxxxxxxxxxxxxxxxxxxx
r	r?s r:�test_encode_one_long_line�$TestQuopri.test_encode_one_long_lines�����*�,N�Or=c�(�URSS5 g)Nz�xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
z�xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
r	r?s r:�test_encode_one_very_long_line�)TestQuopri.test_encode_one_very_long_lines�����*�8�	:r=c�&�URSSSS9 g)Nz=====z=3D=
=3D=
=3D=
=3D=
=3Dr�r�r	r?s r:�test_encode_shortest_maxlinelen�*TestQuopri.test_encode_shortest_maxlinelen s�����'�#7�A��Fr=c�F�UR[URSSSS9 g)Nr+r�r�)r�r�r	r?s r:� test_encode_maxlinelen_too_small�+TestQuopri.test_encode_maxlinelen_too_small#s!�����*�d�&7�&7��R�A��Nr=c�v�URnU"[R"S5S5 U"[R"S5S5 U"[R"S5S5 U"[R"SSS9S5 U"[R"SSS	S
9S5 U"[R"S5S5 g)
Nr+rHr^r_�dxxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx rYr�zjxxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx=
 xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxx=
x xxxx xxxx xxxx xxxx=20r�rZzlxxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx=
 xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxx=
x xxxx xxxx xxxx xxxx=20zone line

two line)r3r"rPr�s  r:r[�TestQuopri.test_encode&s���
�
�
��
�:�!�!�"�%�r�*�
�:�!�!�'�*�G�4�
�:�!�!�"2�3�^�D�
�:�!�!�,�2�>�A�	�
	�:�!�!�,�2�6�J��	�
	�:�!�!�#�
��	
r=)rqrsrorprn)NN)Hr[r\r]r^r@ryr}r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r	r	r	r	r	r	r	r	r 	r#	r&	r)	r,	r0	r3	r6	r9	r<	r?	rB	rE	rI	rL	rP	rS	rV	rZ	r]	r`	rc	rf	r[r_rZr=r:rdrdsj��6�,L�J�.�26�I�
B�*�E�B�B�&�B�)�3�B�D�K�4�"�(�,�5�2�0�0�8�:�<�D�B�I�6�#�'�6�I�D�4�4�C�F�<�("�*�0�2�>�9�
&�*�2�4�8�5�9�I�K�K�2�.�B�P�:�G�O�
r=rdc�,�\rSrSrSrSrSrSrSrg)�TestCharsetiBc�L�SSKJn URS	g![a gf=f)Nrr��fake)r�rC�CHARSETSr)r7�
CharsetModules  r:�tearDown�TestCharset.tearDownCs*��2�	��&�&�v�.���	��	�s�
�
#�#c���URn[S5nU"URS5S5 SnUR[URU5 [S5nU"URU5S5 g)NrQ�Hello World!u¤¢¤¤¤¦¤¨¤ªr[z(=?utf-8?b?wqTCosKkwqTCpMKmwqTCqMKkwqo=?=)r3r
r7r�rG)r7r8r�r�s    r:�test_codec_encodeable�!TestCharset.test_codec_encodeableJsc��
�
�
���J���
�1�?�?�>�*�N�;�6�����,�����;��G���
�1�?�?�1��I�Jr=c��URn[S5nU"SURS55 [S5nU"SURS55 [S5nU"SURS55 [S	5nS
SKJn URSURSS5 [S5nU"SURS55 g)
Nr?z
hello w=F6rlduhello wörldr[r�r�rQrtrzrr�rn	)r3r
rPr�rC�add_charset�QP)r7r8r�rp	s    r:�test_body_encode�TestCharset.test_body_encodeUs���
�
�
���L�!��
�?�A�M�M�*:�;�<��G���
�����~�!>�?��J���
�=�!�-�-�
�6�7��H���	3��!�!�&�-�*:�*:�D�'�J��F�O��
�=�!�-�-�
�6�7r=c��[S5nUR[U5S5 UR[R
[S5 g)NrQuascÿii)r
r3r�r�r �CharsetErrorr�s  r:�test_unicode_charset_name�%TestCharset.test_unicode_charset_namets8���*�%������W��z�2����&�-�-�w��Dr=rZN)	r[r\r]r^rq	ru	rz	r~	r_rZr=r:rl	rl	Bs���	K�8�>Er=rl	c��\rSrSrSrSrSrSrSrSr	Sr
S	rS
rSr
SrS
rSrSrSrSrSrSrSrSrSrSrSrSrSrSrg)�
TestHeaderi|c��URn[S5nU"UR5S5 URS5 U"UR5S5 g)Nrt	z Goodbye World!zHello World!  Goodbye World!�r�rr�r�r�s   r:�test_simple�TestHeader.test_simple}sE��
�
"�
"���>�"��
�1�8�8�:�~�&�	���"�#�
�1�8�8�:�5�6r=c��URn[S5nU"UR5S5 URS5 U"UR5S5 g)Nrt	zGoodbye World!zHello World! Goodbye World!r�	r�s   r:�test_simple_surprise�TestHeader.test_simple_surprise�sE��
�
"�
"���>�"��
�1�8�8�:�~�&�	���!�"�
�1�8�8�:�4�5r=c�D�SnUR[U5US4/5 g)Nzno decoding neededr�r�s  r:�test_header_needs_no_decoding�(TestHeader.test_header_needs_no_decoding�s"�� ������q�)�Q��I�;�7r=c��[SSS9nURSS9RS5HnUR[	U5S5 M  g)Na�I am the very model of a modern Major-General; I've information vegetable, animal, and mineral; I know the kings of England, and I quote the fights historical from Marathon to Waterloo, in order categorical; I'm very well acquainted, too, with matters mathematical; I understand equations, both the simple and quadratical; about binomial theorem I'm teeming with a lot o' news, with many cheerful facts about the square of the hypotenuse.rer�r,)�
splitcharsz
 )rr�r�rhr`)r7r��ls   r:�	test_long�TestHeader.test_long�sI���L� �
"�����S��)�/�/��6�A�� � ��Q���,�7r=c��URn[S5n[S5n[S5nSnSnSn[XR5nURXc5 URXt5 UR	SS9n	U"U	S	5 [U	5n
U"[
U
5S
5 U"U
SUS45 U"U
SUS45 U"U
S
UR	S5S45 [U5nU"USRS55 [[U	55nU"X�5 g)Nr?r|r[r�r�r�rer�a=?iso-8859-1?q?Die_Mieter_treten_hier_ein_werden_mit_einem_Foerderband_kom?=
 =?iso-8859-1?q?fortabel_den_Korridor_entlang=2C_an_s=FCdl=FCndischen_Wand?=
 =?iso-8859-1?q?gem=E4lden_vorbei=2C_gegen_die_rotierenden_Klingen_bef=F6r?=
 =?iso-8859-1?q?dert=2E_?= =?iso-8859-2?q?Finan=E8ni_metropole_se_hroutily?=
 =?iso-8859-2?q?_pod_tlakem_jejich_d=F9vtipu=2E=2E_?= =?utf-8?b?5q2j56K6?=
 =?utf-8?b?44Gr6KiA44GG44Go57+76Kiz44Gv44GV44KM44Gm44GE44G+44Gb44KT44CC?=
 =?utf-8?b?5LiA6YOo44Gv44OJ44Kk44OE6Kqe44Gn44GZ44GM44CB44GC44Go44Gv44Gn?=
 =?utf-8?b?44Gf44KJ44KB44Gn44GZ44CC5a6f6Zqb44Gr44Gv44CMV2VubiBpc3QgZGFz?=
 =?utf-8?b?IE51bnN0dWNrIGdpdCB1bmQgU2xvdGVybWV5ZXI/IEphISBCZWloZXJodW5k?=
 =?utf-8?b?IGRhcyBPZGVyIGRpZSBGbGlwcGVyd2FsZHQgZ2Vyc3B1dC7jgI3jgajoqIA=?=
 =?utf-8?b?44Gj44Gm44GE44G+44GZ44CC?=r�rr�r�s�Die Mieter treten hier ein werden mit einem Foerderband komfortabel den Korridor entlang, an südlündischen Wandgemälden vorbei, gegen die rotierenden Klingen befördert. Finančni metropole se hroutily pod tlakem jejich důvtipu.. 正確に言うと翻訳はされていません。一部はドイツ語ですが、あとはでたらめです。実際には「Wenn ist das Nunstuck git und Slotermeyer? Ja! Beiherhund das Oder die Flipperwaldt gersput.」と言っています。)
r�r
rr�r�rr`r�r^r)
r7r8r�r�r�r�r�r�r��encr��ustr�newhs
             r:�test_multilingual�TestHeader.test_multilingual�s��
�
"�
"���L�!��
�\�
"���w���B��$��0�	�
�6���	�����	����!��h�h�"�h�%��
�3�)�	*� ��$��
�3�w�<���
�7�1�:���-�.�
�7�1�:���.�/�
�7�1�:�	�(�(��1�7�;�<��1�v��
�4�
D� �f�W�o�#	�&�=��-�.��
�4�r=c�X�[5nURUR5S5 gr�r�r�s  r:�test_empty_header_encode�#TestHeader.test_empty_header_encode�s���H���������R�(r=c��URn[5nU"US5 URS[S55 U"US5 g)Nr+r�r?)r�rr�r
r�s   r:�test_header_ctor_default_args�(TestHeader.test_header_ctor_default_args�s9��
�
"�
"���H��
�1�b�	�	������-�.�
�1�e�r=c�V�URnSn[U5nU"UR5S5 U"[U5U5 [USS9nU"UR5S5 U"[U5U5 [USSS9nU"UR5U5 U"[U5U5 g)Nz|A very long line that must get split to something other than at the 76th character boundary to test the non-default behaviorz}A very long line that must get split to something other than at the 76th
 character boundary to test the non-default behaviorrKr�z}A very long line that must get split to something other than at the
 76th character boundary to test the non-default behaviori)r�r�)r�rr�r�r�s    r:�test_explicit_maxlinelen�#TestHeader.test_explicit_maxlinelen�s���
�
"�
"����
�4�L��
�1�8�8�:�8�	9�	�3�q�6�4���4�Y�/��
�1�8�8�:�=�	>�	�3�q�6�4���4�D�i�@��
�1�8�8�:�t��
�3�q�6�4�r=c
��URn[SSS9nSnURU5 UR5nU"US5 U"U[	[[
U5555 [SSS9nURS5 UR5nU"US5 U"U[	[[
U5555 g)Nr?rN�rCr�ri	a=?iso-8859-1?q?xxx?=
 =?iso-8859-1?q?x_?=
 =?iso-8859-1?q?xx?=
 =?iso-8859-1?q?xx?=
 =?iso-8859-1?q?_x?=
 =?iso-8859-1?q?xx?=
 =?iso-8859-1?q?x_?=
 =?iso-8859-1?q?xx?=
 =?iso-8859-1?q?xx?=
 =?iso-8859-1?q?_x?=
 =?iso-8859-1?q?xx?=
 =?iso-8859-1?q?x_?=
 =?iso-8859-1?q?xx?=
 =?iso-8859-1?q?xx?=
 =?iso-8859-1?q?_x?=
 =?iso-8859-1?q?xx?=
 =?iso-8859-1?q?x_?=
 =?iso-8859-1?q?xx?=
 =?iso-8859-1?q?xx?=
 =?iso-8859-1?q?_x?=
 =?iso-8859-1?q?xx?=
 =?iso-8859-1?q?x_?=
 =?iso-8859-1?q?xx?=
 =?iso-8859-1?q?xx?=
 =?iso-8859-1?q?_x?=
 =?iso-8859-1?q?xx?=
 =?iso-8859-1?q?x_?=
 =?iso-8859-1?q?xx?=
 =?iso-8859-1?q?xx?=
 =?iso-8859-1?q?_x?=
 =?iso-8859-1?q?xx?=
 =?iso-8859-1?q?x_?=
 =?iso-8859-1?q?xx?=
 =?iso-8859-1?q?xx?=
 =?iso-8859-1?q?_x?=
 =?iso-8859-1?q?xx?=
 =?iso-8859-1?q?x_?=
 =?iso-8859-1?q?xx?=
 =?iso-8859-1?q?xx?=
 =?iso-8859-1?q?_x?=
 =?iso-8859-1?q?xx?=
 =?iso-8859-1?q?x_?=
 =?iso-8859-1?q?xx?=
 =?iso-8859-1?q?xx?=
 =?iso-8859-1?q?_x?=
 =?iso-8859-1?q?xx?=
 =?iso-8859-1?q?x_?=
 =?iso-8859-1?q?xx?=
 =?iso-8859-1?q?xx?=
 =?iso-8859-1?q?_?=rYz�=?iso-8859-1?q?xxxx_xxxx_xxxx_xxxx_xxx?=
 =?iso-8859-1?q?x_xxxx_xxxx_xxxx_xxxx_?=
 =?iso-8859-1?q?xxxx_xxxx_xxxx_xxxx_xx?=
 =?iso-8859-1?q?xx_xxxx_xxxx_xxxx_xxxx?=
 =?iso-8859-1?q?_xxxx_xxxx_?=�r�rr�r�r�rr�r7r8r�rr�s     r:�test_quopri_splittable�!TestHeader.test_quopri_splittable�s���
�
"�
"���<�B�7����	�����
�H�H�J��
�1�2�2	�f	�1�c�+�m�A�.�/�0�1��<�B�7��	�����
�H�H�J��
�1�!�	"�	�1�c�+�m�A�.�/�0�1r=c
��URn[SSS9nSnURU5 UR5nU"US5 U"U[	[[
U5555 [SSS9nURU5 UR5nU"US5 U"U[	[[
U5555 g)Nr}rNr�	ri	a�=?koi8-r?b?eHh4?=
 =?koi8-r?b?eCB4?=
 =?koi8-r?b?eHh4?=
 =?koi8-r?b?IHh4?=
 =?koi8-r?b?eHgg?=
 =?koi8-r?b?eHh4?=
 =?koi8-r?b?eCB4?=
 =?koi8-r?b?eHh4?=
 =?koi8-r?b?IHh4?=
 =?koi8-r?b?eHgg?=
 =?koi8-r?b?eHh4?=
 =?koi8-r?b?eCB4?=
 =?koi8-r?b?eHh4?=
 =?koi8-r?b?IHh4?=
 =?koi8-r?b?eHgg?=
 =?koi8-r?b?eHh4?=
 =?koi8-r?b?eCB4?=
 =?koi8-r?b?eHh4?=
 =?koi8-r?b?IHh4?=
 =?koi8-r?b?eHgg?=
 =?koi8-r?b?eHh4?=
 =?koi8-r?b?eCB4?=
 =?koi8-r?b?eHh4?=
 =?koi8-r?b?IHh4?=
 =?koi8-r?b?eHgg?=
 =?koi8-r?b?eHh4?=
 =?koi8-r?b?eCB4?=
 =?koi8-r?b?eHh4?=
 =?koi8-r?b?IHh4?=
 =?koi8-r?b?eHgg?=
 =?koi8-r?b?eHh4?=
 =?koi8-r?b?eCB4?=
 =?koi8-r?b?eHh4?=
 =?koi8-r?b?IA==?=rYz�=?koi8-r?b?eHh4eCB4eHh4IHh4eHggeHh4?=
 =?koi8-r?b?eCB4eHh4IHh4eHggeHh4eCB4?=
 =?koi8-r?b?eHh4IHh4eHggeHh4eCB4eHh4?=
 =?koi8-r?b?IHh4eHggeHh4eCB4eHh4IHh4?=
 =?koi8-r?b?eHggeHh4eCB4eHh4IHh4eHgg?=
 =?koi8-r?b?eHh4eCB4eHh4IA==?=r�	r�	s     r:�test_base64_splittable�!TestHeader.test_base64_splittable7s���
�
"�
"���8��3����	�����
�H�H�J��
�1�"�"	�F	�1�c�+�m�A�.�/�0�1��8��3��	�����
�H�H�J��
�1�"�	#�	�1�c�+�m�A�.�/�0�1r=c��URnSn[U5nU"US/5 [U5nU"X$R55 g)NrH)rHN�r3rrr�)r7r8r�rr�s     r:�test_us_ascii_header�TestHeader.test_us_ascii_headerms@��
�
�
�����!���
�1��� ���N��
�1�h�h�j�r=c�f�URn[5nURSS5 U"US5 g)NrHr?)r3rr�r�s   r:�test_string_charset�TestHeader.test_string_charsetus+��
�
�
���H��	����,�'�
�1�g�r=c��URn[SS5nU"UR5S5 [SS5nU"UR5S5 g)Nr�r[z=?utf-8?q?p=C3=B6stal?=u菊地時夫z=?utf-8?b?6I+K5Zyw5pmC5aSr?=�r3rr�r�s   r:�test_utf8_shortest�TestHeader.test_utf8_shortest�sH��
�
�
���;��(��
�1�8�8�:�0�1��-�w�7��
�1�8�8�:�5�6r=c	�<�URnURnSnU"[[U5 [5nU"[URU5 URSS5nU"[
[USS95U5 UR	USS9 U"[
U5U5 g)N�0Ynwp4dUEbay Auction Semiar- No Charge � Earn Bigr[rr)r�r3rGrr�r^r�)r7rr8rr��es      r:�test_bad_8bit_header�TestHeader.test_bad_8bit_header�s����"�"��
�
�
��B���|�V�Q�'��H���|�Q�X�X�q�)�
�H�H�W�i�(��
�3�v�a�	�*�+�Q�/�	����9��%�
�3�q�6�1�
r=c�
�SnURSS5n[U[RRS9nUR[
U5S5 UR[RRU5US4/5 g)Nr�	r��surrogateescaper��2Ynwp4dUEbay Auction Semiar- No Charge � Earn Big�unknown-8bit)	r^rr�rC�UNKNOWN8BITr3r�r�r)r7rr�	r�s    r:�test_escaped_8bit_header�#TestHeader.test_escaped_8bit_header�sm��B��
�H�H�W�/�0���1�e�m�m�7�7�8������Q��O�	Q�������3�3�A�6�!�^�9L�8M�Nr=c���Sn[U[RRS9nUR	[U5S5 UR	[RRU5US4/5 g�Nr�	r�r�	r�	)rr�rCr�	r3r�r�r)r7rr�s   r:�&test_header_handles_binary_unknown8bit�1TestHeader.test_header_handles_binary_unknown8bit�s\��B���1�e�m�m�7�7�8������Q��O�	Q�������3�3�A�6�!�^�9L�8M�Nr=c�^�Sn[U[RRS9n[RR[RR
U55nUR[U5S5 UR[RR
U5US4/5 gr�	)	rr�rCr�	r�rrr3r�)r7rr��h2s    r:�+test_make_header_handles_binary_unknown8bit�6TestHeader.test_make_header_handles_binary_unknown8bit�s��B���1�e�m�m�7�7�8��
�\�\�
%�
%�e�l�l�&@�&@��&C�
D������R��O�	Q�������3�3�B�7�1�n�:M�9N�Or=c��[S5n[RRU5nUR	S5 UR[
U5S5 g)Nr�)r��test2)rr�r�rr�r3r�)r7r�rCs   r:�0test_modify_returned_list_does_not_change_header�;TestHeader.test_modify_returned_list_does_not_change_header�s@���6�N�����+�+�A�.���
�
�(�)�����Q���(r=c��URn[5nURSS5 URS5 UR5nU"US5 [	[U55nU"UR5U5 g)NrHr?�worldz=?iso-8859-1?q?hello?= world)r3rr�r�rr)r7r8r�r�s    r:� test_encoded_adjacent_nonencoded�+TestHeader.test_encoded_adjacent_nonencoded�sc��
�
�
���H��	����,�'�	�����
�H�H�J��
�1�,�-��
�a�(�)��
�1�8�8�:�q�r=c��URnSn[U5nU"U/SQ5 [U5nU"UR5S5 g)NzGSubject: =?koi8-r?b?8NLP18XSy8EgzsEgxsnOwczYztk=?= =?koi8-r?q?=CA?= zz.))s	Subject: N)s������� � ��������r})s zz.Nz6Subject: =?koi8-r?b?8NLP18XSy8EgzsEgxsnOwczYztnK?= zz.r�	)r7r8r��parts�hdrs     r:�test_whitespace_keeper�!TestHeader.test_whitespace_keeper�sK��
�
�
��U���a� ��
�5�Y�	Z��%� ��
�3�:�:�<�C�	Er=c�X�URnSnU"[R[U5 g)NzXSubject: =?EUC-KR?B?CSixpLDtKSC/7Liuvsax4iC6uLmwMcijIKHaILzSwd/H0SC8+LCjwLsgv7W/+Mj3I ?=)r�r r�r)r7rr�s   r:�test_broken_base64_header�$TestHeader.test_broken_base64_header�s$���"�"��f���v�&�&�
�q�9r=c�X�[SSS9nURUR5S5 g)Nr��	shift_jisr�r�r�r�s  r:�test_shift_jis_charset�!TestHeader.test_shift_jis_charset�s%���5�+�.���������%E�Fr=c�f�[R"S5nUR[U5S5 g)NzEmptyHeader:zEmptyHeader: 

)r�rr3r�rps  r:�!test_flatten_header_with_no_value�,TestHeader.test_flatten_header_with_no_value�s)���'�'��7������S��#6�7r=c�X�[5nSUS'UR[U5S5 g)Nz   value with leading ws�
SomeHeaderz&SomeHeader:    value with leading ws

)rr3r�rps  r:�)test_encode_preserves_leading_ws_on_value�4TestHeader.test_encode_preserves_leading_ws_on_value�s(���i��6��L������S��#M�Nr=c�V�UR[S5R5S5 g)Nr,r�	r?s r:�test_whitespace_header�!TestHeader.test_whitespace_header�s��������+�+�-�s�3r=rZN)r[r\r]r^r�	r�	r�	r�	r�	r�	r�	r�	r�	r�	r�	r�	r�	r�	r�	r�	r�	r�	r�	r�	r�	r�	r�	r�	r�	r_rZr=r:r�	r�	|s���7�6�8�-�=�~)���&C2�J42�l��7�
�O�O�P�)��E�:�
G�8�O�
4r=r�	c���\rSrSrSrSrSrSrSrSr	Sr
S	rS
rSr
SrS
rSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSr Sr!S r"g!)"�TestRFC2231i�c��URnURS5nU"URS5S5 U"URSSS9S5 g)Nz
msg_29.txtr��rQr��%This is even more ***fun*** isn't it!FrP)rQr�z'"This is even more ***fun*** isn't it!")r3r4rKr6s   r:rI�TestRFC2231.test_get_param�sM��
�
�
���l�l�<�(��
�3�=�=��!�G�	I�
�3�=�=��%�=�0�I�	Kr=c�H�URn[5nURSSSS9 U"URS5S5 URSSSSS9 U"URS5S5 UR	S	5nURSSSSS9 U"URS
S9S5 g)
Nr�r�	rQr�)rQr+r�	r��rC�languager�	r�rr	a"Return-Path: <bbb@zzz.org>
Delivered-To: bbb@zzz.org
Received: by mail.zzz.org (Postfix, from userid 889)
	id 27CEAD38CC; Fri,  4 May 2001 14:05:44 -0400 (EDT)
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Message-ID: <15090.61304.110929.45684@aaa.zzz.org>
From: bbb@ddd.com (John X. Doe)
To: bbb@zzz.org
Subject: This is a test message
Date: Fri, 4 May 2001 14:05:44 -0400
Content-Type: text/plain; charset=us-ascii;
 title*=us-ascii'en'This%20is%20even%20more%20%2A%2A%2Afun%2A%2A%2A%20isn%27t%20it%21


Hi,

Do you like this message?

-Me
)r�rrsrKr4r�r6s   r:rt�TestRFC2231.test_set_param�s���
�
"�
"���i���
�
�g�G�(�	�	*�
�3�=�=��!�E�	G��
�
�g�G�(�4�	�	9�
�3�=�=��!�G�	I��l�l�<�(���
�
�g�G�(�4�	�	9�
�3�=�=�b�=�)�,�	r=c��[5nURSS5 URUSS5 URSSSS9 URUSS5 URSS	SS9 URUSS
5 g)Nr�r�rBztext/plain; title="foo"r9F)�requoteztext/plain; title=barz	(bar)bellztext/plain; title="(bar)bell")rrsr3rps  r:�test_set_param_requote�"TestRFC2231.test_set_param_requotes}���i���
�
�g�u�%�����^�,�.G�H��
�
�g�u�e�
�4�����^�,�.E�F��
�
�g�{�E�
�:�����^�,�.M�Nr=c���URnURS5nURSSSSS9 URSSSSS9 URSS	S
9 U"UR	SS9S
5 g)Nr�r�r9rQr�r�	r�r�	rFr7rr	a$Return-Path: <bbb@zzz.org>
Delivered-To: bbb@zzz.org
Received: by mail.zzz.org (Postfix, from userid 889)
	id 27CEAD38CC; Fri,  4 May 2001 14:05:44 -0400 (EDT)
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Message-ID: <15090.61304.110929.45684@aaa.zzz.org>
From: bbb@ddd.com (John X. Doe)
To: bbb@zzz.org
Subject: This is a test message
Date: Fri, 4 May 2001 14:05:44 -0400
Content-Type: text/plain; charset="us-ascii";
 title*=us-ascii'en'This%20is%20even%20more%20%2A%2A%2Afun%2A%2A%2A%20isn%27t%20it%21


Hi,

Do you like this message?

-Me
)r�r4rsr~r�r6s   r:r��TestRFC2231.test_del_paramst��
�
"�
"���l�l�<�(���
�
�e�U�J��
�F��
�
�g�G���	�	/��
�
�e�N�
�3�
�3�=�=�b�=�)�,�	r=c�l�URnURS5nU"UR5S5 g)NrlrQ)r3r4�get_content_charsetr6s   r:� test_rfc2231_get_content_charset�,TestRFC2231.test_rfc2231_get_content_charset>s.��
�
�
���l�l�<�(��
�3�"�"�$�j�1r=c���[R"S5n[R"U5nUR	UR5S5 UR	XR
55 g)Nz�            Content-Disposition: inline;
            	filename*0*=''This%20is%20even%20more%20;
            	filename*1*=%2A%2A%2Afun%2A%2A%2A%20;
            	filename*2="is it not.pdf"

            �)This is even more ***fun*** is it not.pdf�r�r�r�rr3r�r�r�s   r:�test_rfc2231_parse_rfc_quoting�*TestRFC2231.test_rfc2231_parse_rfc_quotingD�X���O�O��
���'�'��*������)�)�+�D�	F�����M�M�O�,r=c���[R"S5n[R"U5nUR	UR5S5 UR	XR
55 g)Nz�            Content-Disposition: inline;
            	filename*0*="''This%20is%20even%20more%20";
            	filename*1*="%2A%2A%2Afun%2A%2A%2A%20";
            	filename*2="is it not.pdf"

            r�	r�	r�s   r:� test_rfc2231_parse_extra_quoting�,TestRFC2231.test_rfc2231_parse_extra_quotingRr�	r=c��Sn[R"U5nURS5nURU[5 URUS5 g)NaContent-Transfer-Encoding: 8bit
Content-Disposition: inline; filename="file____C__DOCUMENTS_20AND_20SETTINGS_FABIEN_LOCAL_20SETTINGS_TEMP_nsmail.htm"
Content-Type: text/html; NAME*0=file____C__DOCUMENTS_20AND_20SETTINGS_FABIEN_LOCAL_20SETTINGS_TEM; NAME*1=P_nsmail.htm

�NAMEzMfile____C__DOCUMENTS_20AND_20SETTINGS_FABIEN_LOCAL_20SETTINGS_TEMP_nsmail.htm�r�rrK�assertNotIsInstance�tupler3�r7rr9�params    r:�#test_rfc2231_no_language_or_charset�/TestRFC2231.test_rfc2231_no_language_or_charsetbsN��
���'�'��*���
�
�f�%��� � ���.�����[�	]r=c�t�Sn[R"U5nURUR5S5 g�Nz�Content-Disposition: inline;
	filename*0*="''This%20is%20even%20more%20";
	filename*1*="%2A%2A%2Afun%2A%2A%2A%20";
	filename*2="is it not.pdf"

r�	r)r�s   r:�/test_rfc2231_no_language_or_charset_in_filename�;TestRFC2231.test_rfc2231_no_language_or_charset_in_filenameq�8��
���'�'��*������)�)�+�D�	Fr=c�t�Sn[R"U5nURUR5S5 gr
r)r�s   r:�7test_rfc2231_no_language_or_charset_in_filename_encoded�CTestRFC2231.test_rfc2231_no_language_or_charset_in_filename_encoded~r
r=c�t�Sn[R"U5nURUR5S5 g)Nz�Content-Disposition: inline;
	filename*0="''This%20is%20even%20more%20";
	filename*1*="%2A%2A%2Afun%2A%2A%2A%20";
	filename*2="is it not.pdf"

z1This%20is%20even%20more%20***fun*** is it not.pdfr)r�s   r:�test_rfc2231_partly_encoded�'TestRFC2231.test_rfc2231_partly_encoded�s9��
���'�'��*���������?�	Ar=c�t�Sn[R"U5nURUR5S5 g)Nz�Content-Disposition: inline;
	filename*0="This%20is%20even%20more%20";
	filename*1="%2A%2A%2Afun%2A%2A%2A%20";
	filename*2="is it not.pdf"

z?This%20is%20even%20more%20%2A%2A%2Afun%2A%2A%2A%20is it not.pdfr)r�s   r:�test_rfc2231_partly_nonencoded�*TestRFC2231.test_rfc2231_partly_nonencoded�s9��
���'�'��*���������M�	Or=c�t�Sn[R"U5nURUR5S5 g)Nz�Content-Type: multipart/alternative;
	boundary*0*="''This%20is%20even%20more%20";
	boundary*1*="%2A%2A%2Afun%2A%2A%2A%20";
	boundary*2="is it not.pdf"

r�	r1r�s   r:�/test_rfc2231_no_language_or_charset_in_boundary�;TestRFC2231.test_rfc2231_no_language_or_charset_in_boundary�r
r=c�t�Sn[R"U5nURUR5S5 g)Nz�Content-Type: text/plain;
	charset*0*="This%20is%20even%20more%20";
	charset*1*="%2A%2A%2Afun%2A%2A%2A%20";
	charset*2="is it not.pdf"

z)this is even more ***fun*** is it not.pdf�r�rr3r�	r�s   r:�.test_rfc2231_no_language_or_charset_in_charset�:TestRFC2231.test_rfc2231_no_language_or_charset_in_charset�s8��
���'�'��*������0�0�2�D�	Fr=c�t�Sn[R"U5nURUR5S5 g)Nz�Content-Disposition: inline;
	filename*0*="bogus'xx'This%20is%20even%20more%20";
	filename*1*="%2A%2A%2Afun%2A%2A%2A%20";
	filename*2="is it not.pdf"

r�	r)r�s   r:�%test_rfc2231_bad_encoding_in_filename�1TestRFC2231.test_rfc2231_bad_encoding_in_filename�r
r=c�t�Sn[R"U5nURUR5S5 g)Nz:Content-Type: text/plain; charset*=bogus''utf-8%E2%80%9D

r
r�s   r:�$test_rfc2231_bad_encoding_in_charset�0TestRFC2231.test_rfc2231_bad_encoding_in_charset��6��
���'�'��*��	
����0�0�2�D�9r=c�t�Sn[R"U5nURUR5S5 g)Nz:Content-Type: text/plain; charset*=ascii''utf-8%E2%80%9D

r
r�s   r:�%test_rfc2231_bad_character_in_charset�1TestRFC2231.test_rfc2231_bad_character_in_charset�r'
r=c�t�Sn[R"U5nURUR5S5 g)Nz�Content-Disposition: inline;
	filename*0*="ascii'xx'This%20is%20even%20more%20";
	filename*1*="%2A%2A%2Afun%2A%2A%2A%20";
	filename*2*="is it not.pdf%E2"

u,This is even more ***fun*** is it not.pdf�r)r�s   r:�&test_rfc2231_bad_character_in_filename�2TestRFC2231.test_rfc2231_bad_character_in_filename�s8��
���'�'��*������)�)�+�J�	Lr=c�t�Sn[R"U5nURUR5S5 g)Nz^Content-Transfer-Encoding: 8bit
Content-Disposition: inline; filename*=X-UNKNOWN''myfile.txt

�
myfile.txtr)r�s   r:�test_rfc2231_unknown_encoding�)TestRFC2231.test_rfc2231_unknown_encoding��4��
��
�'�'��*������)�)�+�\�:r=c�t�Sn[R"U5nURUR5S5 g)NucContent-Transfer-Encoding: 8bit
Content-Disposition: inline; filename*=utf-8���''myfile.txt

r/
r)r�s   r:�&test_rfc2231_bad_character_in_encoding�2TestRFC2231.test_rfc2231_bad_character_in_encoding�r2
r=c��URnSn[R"U5nURS5upEnU"US5 U"US5 U"US5 g)NzJContent-Type: application/x-foo;
	name*0*="Frank's"; name*1*=" Document"

rL�Frank's DocumentrH�r7r8rr9rCr�	r�s       r:�-test_rfc2231_single_tick_in_filename_extended�9TestRFC2231.test_rfc2231_single_tick_in_filename_extended�sX��
�
�
��
��
�'�'��*��"�}�}�V�4���1�
�7�D��
�8�T��
�1� �!r=c��Sn[R"U5nURS5nURU[5 URUS5 g)NzGContent-Type: application/x-foo; name*0="Frank's"; name*1=" Document"

rLr7
r
r
s    r:�$test_rfc2231_single_tick_in_filename�0TestRFC2231.test_rfc2231_single_tick_in_filenamesJ��
���'�'��*���
�
�f�%��� � ���.����� 2�3r=c�t�Sn[R"U5nURUR5S5 g)NzAContent-Disposition: inline;
	filename*0*="'This%20is%20broken";
z'This is brokenr)r�s   r:�test_rfc2231_missing_tick�%TestRFC2231.test_rfc2231_missing_ticks8��
���'�'��*����������	r=c�t�Sn[R"U5nURUR5S5 g)NzAContent-Disposition: inline;
	filename*0*="'This%20is%E2broken";
u'This is�brokenr)r�s   r:�0test_rfc2231_missing_tick_with_encoded_non_ascii�<TestRFC2231.test_rfc2231_missing_tick_with_encoded_non_ascii s8��
���'�'��*���������"�	$r=c��URnSn[R"U5nURS5upEnU"US5 U"US5 U"US5 g)NzYContent-Type: application/x-foo;
	name*0*="us-ascii'en-us'Frank's"; name*1*=" Document"

rLrQ�en-usr7
rHr8
s       r:�!test_rfc2231_tick_attack_extended�-TestRFC2231.test_rfc2231_tick_attack_extended+sX��
�
�
��
��
�'�'��*��"�}�}�V�4���1�
�7�J��
�8�W��
�1� �!r=c��Sn[R"U5nURS5nURU[5 URUS5 g)NzWContent-Type: application/x-foo;
	name*0="us-ascii'en-us'Frank's"; name*1=" Document"

rLzus-ascii'en-us'Frank's Documentr
r
s    r:�test_rfc2231_tick_attack�$TestRFC2231.test_rfc2231_tick_attack9sJ��
��
�'�'��*���
�
�f�%��� � ���.����� A�Br=c�|�URnSn[R"U5nU"URS5S5 g)Nz:Content-Type: application/x-foo; name="Frank's Document"

rLr7
rHr1s    r:�test_rfc2231_no_extended_values�+TestRFC2231.test_rfc2231_no_extended_valuesEs:��
�
�
��
���'�'��*��
�3�=�=�� �"4�5r=c��URnSn[R"U5nURS5upEnU"US5 U"US5 U"US5 g)NziContent-Type: application/x-foo;
	name*0*="us-ascii'en-us'My";
	name*1=" Document";
	name*2*=" For You"

rLrQrE
�My Document For YourHr8
s       r:�,test_rfc2231_encoded_then_unencoded_segments�8TestRFC2231.test_rfc2231_encoded_then_unencoded_segmentsO�X��
�
�
��
���'�'��*��"�}�}�V�4���1�
�7�J��
�8�W��
�1�#�$r=c��URnSn[R"U5nURS5upEnU"US5 U"US5 U"US5 g)NziContent-Type: application/x-foo;
	name*0="us-ascii'en-us'My";
	name*1*=" Document";
	name*2*=" For You"

rLrQrE
rO
rHr8
s       r:�,test_rfc2231_unencoded_then_encoded_segments�8TestRFC2231.test_rfc2231_unencoded_then_encoded_segments`rR
r=c��SS/nUH1nURUS9 [R"U5nSSS5 M3 g!,(df   ME=f)Nz�From: user@host.com
To: user@host.com
Bad-Header:
 =?us-ascii?Q?LCSwrV11+IB0rSbSker+M9vWR7wEDSuGqmHD89Gt=ea0nJFSaiz4vX3XMJPT4vrE?=
 =?us-ascii?Q?xGUZeOnp0o22pLBB7CYLH74Js=wOlK6Tfru2U47qR?=
 =?us-ascii?Q?72OfyEY2p2=2FrA9xNFyvH+fBTCmazxwzF8nGkK6D?=

Hello!
u�From: ����� �������� <xxx@xxx>
To: "xxx" <xxx@xxx>
Subject:   ��� ���������� ����� ����� � ��������� �� ����
MIME-Version: 1.0
Content-Type: text/plain; charset="windows-1251";
Content-Transfer-Encoding: 8bit

�� ����� � ���� ������ ��� ��������
)r)r]r�r)r7�messagesrr9s    r:�+test_should_not_hang_on_invalid_ew_messages�7TestRFC2231.test_should_not_hang_on_invalid_ew_messagesosL������"�A������"��/�/��2��#�"��"�"�s	�=�
A	rZN)#r[r\r]r^rIrtr�	r�r�	r�	r
r

r
r
r
r
r
r
r"
r%
r)
r,
r0
r4
r9
r<
r?
rB
rF
rI
rL
rP
rT
rX
r_rZr=r:r�	r�	�s���K�#�JO��B2�-�-� ]�
F�
F�A�O�
F�F�
F�:�:�
L�;�;�"�4��$�"�	C�6�
%�"
%�3r=r�	c�2�\rSrSrSrSrSrSrSrSr	g)	�
TestSignedi�c��[USS9nUR5n[R"U5nSSS5 X44$!,(df   WW4$=fr9r:)r7r!r��originalr9s     r:�_msg_and_obj�TestSigned._msg_and_obj�sM��
�h��
1�R��w�w�y�H��+�+�H�5�C�2��}��2�
1���}��s	�'=�
Ac��SSKnUR"SURUR-5nUR	U5RS5nUR	U5RS5nUR
Xe5 g)Nrz^--([^\n]+)\n(.*?)\n--\1$r�)rArB�SrS�search�groupr3)r7r]
�resultrA�repart�inpart�outparts       r:�_signed_parts_eq�TestSigned._signed_parts_eq�sb������8�"�$�$����+�F�����x�(�.�.�q�1���-�-��'�-�-�a�0������)r=c�l�URS5upUR5nURX5 gr��r^
r�rh
�r7r]
r9rd
s    r:�test_long_headers_as_string�&TestSigned.test_long_headers_as_string�s-���)�)�,�7�
����������h�/r=c�j�URS5upURSS9nURX5 g)Nr��<r	rk
rl
s    r:�(test_long_headers_as_string_maxheaderlen�3TestSigned.test_long_headers_as_string_maxheaderlen�s2���)�)�,�7�
�����B��/�����h�/r=c��URS5up[5n[U5RU5 UR	5nURX5 gr�)r^
rrr�r�rh
)r7r]
r9r�rd
s     r:�test_long_headers_flatten�$TestSigned.test_long_headers_flatten�sF���)�)�,�7�
��
�Z���"�
���c�"���������h�/r=rZN)
r[r\r]r^r^
rh
rm
rq
rt
r_rZr=r:r[
r[
�s���*�0�
0�
0r=r[
c��\rSrSrSrSrg)�TestHeaderRegistryi�c��[5nU"SS5nURURS[R5 g)Nr�zattachment; 0*00="foo"r)rrrr rt)r7�regr�s   r:�test_HeaderRegistry�&TestHeaderRegistry.test_HeaderRegistry�s6������%�'?�@�����a�i�i��l�F�,F�,F�Gr=rZN)r[r\r]r^rz
r_rZr=r:rw
rw
�s��Hr=rw
�__main__)grAr�r\r�r��iorr�	itertoolsr�randomr�	threadingr�
unittest.mockr	r��email.policy�email.utils�
email.charsetr
�email.generatorrrr
�email.headerrrr�email.headerregistryr�
email.messager�email.mime.applicationr�email.mime.audior�email.mime.baser�email.mime.imager�email.mime.messager�email.mime.multipartr�email.mime.nonmultipartr�email.mime.textr�email.parserrrrrr r!r"r#r�r$�test.supportr%�test.support.os_helperr&�test.test_emailr'r(r)r�rr�r.�TestCaserar�r=rXr�r�r�r�rSr|r�r/r7r�rr?rWr�r6r?rDrFrdrl	r�	r�	r[
rw
r[�mainrZr=r:�<module>r�
s���

��
��� ��������!�G�G�;�;�/�!�2�&�$�&�*�.�4�$�-��������)�)�3�$�	������bN�]�bN�N?�8�$�$�?�Fx>�m�x>�zK/�x�(�(�K/�^/D�H�%�%�/D�h7D�H�%�%�7D�vXC�(�+�+�XC�x7A�8�$�$�7A�x~6�M�~6�Bt1�
�t1�rIH�-�IH�ZsK�m�sK�n		J�}�	J�"Z-�]�Z-�~lH�
�lH�`d(�M�d(�N-A�m�-A�`QF�-�QF�hj�M�j�Z
-�-�$3�%E�$2�3�8�'G�'5�8�1D��"�"�1D�h}
��"�"�}
�D
5E�(�#�#�5E�ta4��a4�La3�-�a3�N
0��0�BH��H��z���M�M�O�r=

Youez - 2016 - github.com/yon3zu
LinuXploit