
    daf                         d dl Z d dlZd dlZd dlmZ d dlmZ d dlZd dlmZ	 d dl
mZ d Zd Z G d d	e      Z G d
 de      Zd Zd Zedk(  r ej&                          yy)    N)StringIO)TestEmailBase)__file__)
_structurec                     ddl m}m}m}  | | |t              t
        j                  d|             }t        |d      S )Nr   )joindirnameabspathmoredatar)os.pathr   r	   r
   testfileospardiropen)filenamer   r	   r
   paths        7/root/Python-3.12.4/Lib/test/test_email/torture_test.pyopenfiler      s2    ..4)299j(KLDc?    c                  V    	 t        d       y # t        $ r t        j                  w xY w)Ncrispin-torture.txt)r   OSErrorunittestSkipTest r   r   setUpModuler      s+     &'   s    (c                       e Zd Zd Zy)TortureBasec                     t        |      }	 t        j                  |      }|j                          |S # |j                          w xY wN)r   emailmessage_from_fileclose)selfr   fpmsgs       r   _msgobjzTortureBase._msgobj#   s<    h	))"-CHHJ
 HHJs	   4 AN)__name__
__module____qualname__r(   r   r   r   r   r   "   s    r   r   c                       e Zd Zd Zy)TestCrispinTorturec                 n   | j                   }| j                  }| j                  d      }|j                         } |t	        |      t
                |t        |      d        ||j                  d         ||j                  d       t               }t        ||        ||j                         d       y )Nr      
)r&   a:  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
)assertEqualndiffAssertEqualr(   get_payloadtypelistlenpreambleepiloguer   r   getvalue)r%   eqneqr'   payloadr&   s         r   test_mondo_messagez%TestCrispinTorture.test_mondo_message/   s    ##ll01//#
4=$
3w<
3<<
3<< Z32BKKM 5 5	r   N)r)   r*   r+   r=   r   r   r   r-   r-   -   s    Br   r-   c                      t         j                  t           } t        |       D cg c]   }|j	                  d      st        | |      " c}S c c}w )NTest)sysmodulesr)   dir
startswithgetattr)modnames     r   _testclassesrG   s   s:    
++h
C+.s8O4tv7NGCOOOs
   AAc                     | j                         }t               D ]"  }|j                  | j                  |             $ |S r!   )
suiteClassrG   addTestloadTestsFromTestCase)loadertestspatternsuite	testclasss        r   
load_testsrQ   x   s=    E!^ ?	f229=>?Lr   __main__)r@   r   r   ior   test.test_emailr   r"   r   r   email.iteratorsr   r   r   r   r-   rG   rQ   r)   mainr   r   r   <module>rW      si     	   )  & & - D DLP
 zHMMO r   