HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //usr/local/lib/python3.10/test/test_email/__pycache__/test_inversion.cpython-310.opt-2.pyc
o

�i��@s~	ddlZddlZddlmZmZddlmZddlmZddl	m
Z
mZdd�ZeGdd	�d	e
��Z
ed
kr=e��dSdS)�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��;/usr/local/lib/python3.10/test/test_email/test_inversion.py�
<listcomp>s �zdedent.<locals>.<listcomp>)�
splitlines�strip�
ValueErrorr	�lstrip�join)Zbstr�linesr
rr�dedents
��rc@s^eZdZejZeZdd�Zed�fed�fd�Z	e
dd�e
dd	d
�e
ddd
�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_inputsl            From: abc@xyz.com
            X-Status: 
            Subject: test

            foo
            s�            Date: Tue, 06 Jun 2017 27:39:33 +0600
            From: abc@xyz.com
            Subject: timezones

            How do they work even?
            )Zheader_with_one_space_bodyZheader_with_invalid_datea,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_textcKsl|��}d|d<d|d<d|d<|j|fi|��t|�}t||jd�}|�t|�|�|�|��|�dS)NZfooZFromZbarZTozpayload round trip testZSubjectr)Z
_make_messageZset_content�bytesrrrZget_content)rr#�kwrr Zmsg2r
r
r�payload_as_bodyAszTestInversion.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
2�