Your IP : 216.73.216.213


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

U

i�f�@sxddlZddlZddlmZmZddlmZddlmZddl	m
Z
mZdd�ZeGdd	�d	e
��Z
ed
krte��dS)�N)�policy�message_from_bytes)�EmailMessage)�BytesGenerator)�
TestEmailBase�parameterizecsP|��}|d��std��t|d�t|d����d��fdd�|D��S)NrzFirst line must contain texts
cs(g|] }t|��kr |�d�nd�qS)N�)�len)�.0�x�Zstripamt��C/opt/alt/python38/lib64/python3.8/test/test_email/test_inversion.py�
<listcomp>s�zdedent.<locals>.<listcomp>)�
splitlines�strip�
ValueErrorr	�lstrip�join)Zbstr�linesr
rr�dedents
��rc@sVeZdZejZeZdd�Zded�fiZ	e
dd�e
ddd	�e
dd
d	�d�Zdd
�ZdS)�
TestInversioncCs<t|tjd�}t��}t|�}|�|�|�|��|�dS)N�r)	rrZSMTP�io�BytesIOrZflatten�assertEqual�getvalue)�self�msg�m�b�gr
r
r�msg_as_input s

zTestInversion.msg_as_inputZheader_with_one_space_bodysl            From: abc@xyz.com
            X-Status: 
            Subject: test

            foo
            a,This is a test
This is a test
This is a test
This is a test
This is a test
This is a test
This is a test
This is a test
This is a test
This is a test
This is a test
This is a test
This is a test
This is a test
This is a test
This is a test
This is a test
This is a test
This is a test
This is a test
)�payloada%xy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy a
xy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy a
xy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy a
xy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy a
xy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy axy a
�base64)r#Zctezquoted-printable)Z
plain_textZbase64_textZqp_textcKsh|��}d|d<d|d<d|d<|j|f|�t|�}t||jd�}|�t|�|�|�|��|�dS)NZfooZFromZbarZTozpayload round trip testZSubjectr)Z
_make_messageZset_content�bytesrrrZget_content)rr#�kwrr Zmsg2r
r
r�payload_as_body9szTestInversion.payload_as_bodyN)
�__name__�
__module__�__qualname__r�defaultr�messager"rZ
msg_params�dictZpayload_paramsr'r
r
r
rrs	�

�r�__main__)rZunittestZemailrrZ
email.messagerZemail.generatorrZtest.test_emailrrrrr(�mainr
r
r
r�<module>s
*