Your IP : 216.73.216.213


Current Path : /opt/alt/python34/lib64/python3.4/test/test_email/__pycache__/
Upload File :
Current File : //opt/alt/python34/lib64/python3.4/test/test_email/__pycache__/test_inversion.cpython-34.pyc

�
f fI�@s�dZddlZddlZddlmZmZddlmZddlm	Z	m
Z
dd�Ze
Gdd	�d	e	ej��Z
ed
kr�ej�ndS)z�Test the parser and generator are inverses.

Note that this is only strictly true if we are parsing RFC valid messages and
producing RFC valid messages.
�N)�policy�message_from_bytes)�BytesGenerator)�
TestEmailBase�parameterizecso|j�}|dj�s+td��nt|d�t|dj���dj�fdd�|D��S)NrzFirst line must contain texts
cs8g|].}t|��kr.|�d�nd�qS)N�)�len)�.0�x)�stripamt��C/opt/alt/python34/lib64/python3.4/test/test_email/test_inversion.py�
<listcomp>s	zdedent.<locals>.<listcomp>)�
splitlines�strip�
ValueErrorr�lstrip�join)Zbstr�linesr)rr
�dedents$rc@s2eZdZdd�Zied�fd6ZdS)�
TestInversioncCsTt|dtj�}tj�}t|�}|j|�|j|j�|�dS)Nr)	rrZSMTP�io�BytesIOrZflattenZassertEqual�getvalue)�self�msg�m�b�grrr
�msg_as_inputs

zTestInversion.msg_as_inputsl            From: abc@xyz.com
            X-Status: 
            Subject: test

            foo
            Zheader_with_one_space_bodyN)�__name__�
__module__�__qualname__rrZ
msg_paramsrrrr
rsr�__main__)�__doc__rZunittestZemailrrZemail.generatorrZtest.test_emailrrrZTestCaserr �mainrrrr
�<module>s