Your IP : 216.73.216.213


Current Path : /opt/alt/python39/lib64/python3.9/test/test_email/__pycache__/
Upload File :
Current File : //opt/alt/python39/lib64/python3.9/test/test_email/__pycache__/torture_test.cpython-39.opt-2.pyc

a

XC?h�@s�ddlZddlZddlZddlmZddlmZddlmZddl	Z	ddl	m
Zddlm
Z
dd�Zzed	�Wney�ej�Yn0Gd
d�de�ZGdd
�d
e�Zdd�Zdd�Zdd�Zedkr�ejdd�dS)�N)�StringIO)�
TestEmailBase)�run_unittest)�__file__)�
_structurecCs6ddlm}m}m}|||t�tjd|��}t|d�S)Nr)�join�dirname�abspathZmoredata�r)Zos.pathrrr	�testfile�os�pardir�open)�filenamerrr	�path�r�A/opt/alt/python39/lib64/python3.9/test/test_email/torture_test.py�openfilesr�crispin-torture.txtc@seZdZdd�ZdS)�TortureBasecCs.t|�}zt�|�}W|��n
|��0|S�N)r�emailZmessage_from_file�close)�selfr�fp�msgrrr�_msgobj#s
zTortureBase._msgobjN)�__name__�
__module__�__qualname__rrrrrr"src@seZdZdd�ZdS)�TestCrispinTorturecCsv|j}|j}|�d�}|��}|t|�t�|t|�d�||jd�||jd�t	�}t
||d�||��d�dS)Nr��
)ra:multipart/mixed
    text/plain
    message/rfc822
        multipart/alternative
            text/plain
            multipart/mixed
                text/richtext
            application/andrew-inset
    message/rfc822
        audio/basic
    audio/basic
    image/pbm
    message/rfc822
        multipart/mixed
            multipart/mixed
                text/plain
                audio/x-sun
            multipart/mixed
                image/gif
                image/gif
                application/x-be2
                application/atomicmail
            audio/x-sun
    message/rfc822
        multipart/mixed
            text/plain
            image/pgm
            text/plain
    message/rfc822
        multipart/mixed
            text/plain
            image/pbm
    message/rfc822
        application/postscript
    image/gif
    message/rfc822
        multipart/mixed
            audio/basic
            audio/basic
    message/rfc822
        multipart/mixed
            application/postscript
            text/plain
            message/rfc822
                multipart/mixed
                    text/plain
                    multipart/parallel
                        image/gif
                        audio/basic
                    application/atomicmail
                    message/rfc822
                        audio/x-sun
)ZassertEqualZndiffAssertEqualrZget_payload�type�list�lenZpreambleZepiloguerr�getvalue)r�eqZneqrZpayloadrrrr�test_mondo_message/s
z%TestCrispinTorture.test_mondo_messageN)rrrr(rrrrr -sr cs tjt��fdd�t��D�S)Ncs g|]}|�d�rt�|��qS)ZTest)�
startswith�getattr)�.0�name��modrr�
<listcomp>u�z _testclasses.<locals>.<listcomp>)�sys�modulesr�dirrrr-r�_testclassesss
r4cCs(t��}t�D]}|�t�|��q|Sr)�unittestZ	TestSuiter4ZaddTestZ	makeSuite)�suite�	testclassrrrr6xs
r6cCst�D]}t|�qdSr)r4r)r7rrr�	test_mains
r8�__main__)ZdefaultTest)r1rr5�iorZtest.test_emailrZtest.supportrrrrZemail.iteratorsrr�OSErrorZSkipTestrr r4r6r8r�mainrrrr�<module>	s(F