ó
ŒwÛjc           @   s†  d  d l  Z  d  d l Z d  d l Z d  d l Z d  d l Z d  d l Z d  d l Z d  d l Z d  d l	 Z	 d  d l
 Z
 d  d l m Z y d  d l Z Wn e k
 r± d Z n Xe j Z d „  Z e
 j e d ƒ d e
 j f d „  ƒ  Yƒ Z d „  Z d Z d	 Z e
 j e d ƒ d
 e
 j f d „  ƒ  Yƒ Z d e
 j f d „  ƒ  YZ e
 j e d ƒ d e
 j f d „  ƒ  Yƒ Z e
 j e d ƒ d e
 j f d „  ƒ  Yƒ Z i d d 6d d 6d d 6Z d+ Z d Z i d d 6d d 6d d 6Z d  Z  i d d g d! 6d g d" 6Z! d# e j" f d$ „  ƒ  YZ# d% e j$ f d& „  ƒ  YZ% e
 j e d ƒ d' e
 j f d( „  ƒ  Yƒ Z& d d) „ Z' e( d* k r‚e' ƒ  n  d S(,   iÿÿÿÿN(   t   test_supportc   
      C   sÚ   | j  d ƒ |  j ƒ  z§ y | j ƒ  \ } } Wn t j k
 rF nw Xd } xc | r² | d k r² t j g  | g g  ƒ \ } } } | r¥ | j | ƒ }	 | |	 } n  | d 8} qP W| j ƒ  Wd  | j ƒ  |  j ƒ  Xd  S(   Ni   iô  i    i   (   t   listent   sett   acceptt   sockett   timeoutt   selectt   sendt   close(
   t   evtt   buft   servt   connt   addrt   nt   rt   wt   et   sent(    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_smtplib.pyt   server   s"    
 !
s!   Threading required for this test.t   GeneralTestsc           B   sP   e  Z d  „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 RS(   c         C   s¹   t  j ƒ  |  _ t j ƒ  |  _ t j t j t j ƒ |  _	 |  j	 j
 d ƒ t  j |  j	 ƒ |  _ |  j d |  j	 f } t j d t d | ƒ |  _ |  j j ƒ  |  j j ƒ  |  j j ƒ  d  S(   Ni   s   220 Hola mundo
t   targett   args(   R    t   threading_setupt   _threadst	   threadingt   EventR	   R   t   AF_INETt   SOCK_STREAMt   sockt
   settimeoutt	   bind_portt   portt   ThreadR   t   threadt   startt   waitt   clear(   t   selft   servargs(    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_smtplib.pyt   setUp.   s    c         C   s.   |  j  j ƒ  |  j j ƒ  t j |  j Œ  d  S(   N(   R	   R$   R"   t   joinR    t   threading_cleanupR   (   R&   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_smtplib.pyt   tearDown:   s    c         C   s#   t  j t |  j ƒ } | j ƒ  d  S(   N(   t   smtplibt   SMTPt   HOSTR    R   (   R&   t   smtp(    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_smtplib.pyt
   testBasic1?   s    c         C   s*   t  j d t |  j f ƒ } | j ƒ  d  S(   Ns   %s:%s(   R,   R-   R.   R    R   (   R&   R/   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_smtplib.pyt
   testBasic2D   s    c         C   s<   t  j t |  j d d ƒ} |  j | j d ƒ | j ƒ  d  S(   Nt   local_hostnamet   testhost(   R,   R-   R.   R    t   assertEqualR2   R   (   R&   R/   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_smtplib.pyt   testLocalHostNameI   s    c         C   sq   |  j  t j ƒ  ƒ t j d ƒ z t j t |  j ƒ } Wd  t j d  ƒ X|  j	 | j
 j ƒ  d ƒ | j ƒ  d  S(   Ni   (   t   assertIsNoneR   t   getdefaulttimeoutt   setdefaulttimeoutR,   R-   R.   R    t   NoneR4   R   t
   gettimeoutR   (   R&   R/   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_smtplib.pyt   testTimeoutDefaultO   s    c         C   st   |  j  t j ƒ  ƒ t j d ƒ z t j t |  j d d  ƒ} Wd  t j d  ƒ X|  j  | j	 j
 ƒ  ƒ | j ƒ  d  S(   Ni   R   (   R6   R   R7   R8   R,   R-   R.   R    R9   R   R:   R   (   R&   R/   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_smtplib.pyt   testTimeoutNoneY   s    c         C   sB   t  j t |  j d d ƒ} |  j | j j ƒ  d ƒ | j ƒ  d  S(   NR   i   (   R,   R-   R.   R    R4   R   R:   R   (   R&   R/   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_smtplib.pyt   testTimeoutValuec   s    (
   t   __name__t
   __module__R(   R+   R0   R1   R5   R;   R<   R=   (    (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_smtplib.pyR   +   s   						
	
c         C   så   | j  ƒ  z™ y~ t t d ƒ r+ t j } n	 t j } d } xM t j r‰ | d k r‰ | d t j ƒ | j ƒ  r| |  j ƒ  Pn  | d 8} q= WWn t	 j
 k
 r¡ n XWd  | j ƒ  sÌ t j d ƒ |  j ƒ  n  t j ƒ  | j  ƒ  Xd  S(   Nt   polliè  i    g{®Gáz„?i   g      à?(   R   t   hasattrR   t   asyncoret   poll2R@   t
   socket_mapt   is_setR   R   R   t   timet   sleept	   close_all(   R   t   serv_evtt
   client_evtt   poll_funR   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_smtplib.pyt   debugging_serverj   s(    
 	

s&   ---------- MESSAGE FOLLOWS ----------
s&   ------------ END MESSAGE ------------
t   DebuggingServerTestsc           B   sb   e  Z d  „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 d	 „  Z RS(
   c         C   sæ   t  j |  _ t j ƒ  |  _ |  j t  _ t j ƒ  |  _ t j	 ƒ  |  _
 t j	 ƒ  |  _ t j t d f d ƒ |  _ |  j j j ƒ  d |  _ |  j |  j
 |  j f } t j d t d | ƒ |  _ |  j j ƒ  |  j
 j ƒ  |  j
 j ƒ  d  S(   Ni    t   nowhereiÿÿÿÿi   R   R   (   RN   iÿÿÿÿ(   t   syst   stdoutt
   old_stdoutt   StringIOt   outputR    R   R   R   R   RI   RJ   t   smtpdt   DebuggingServerR.   R   R   t   getsocknameR    R!   RL   R"   R#   R$   R%   (   R&   t	   serv_args(    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_smtplib.pyR(   •   s    c         C   sG   |  j  j ƒ  |  j j ƒ  |  j j ƒ  t j |  j Œ  |  j	 t
 _ d  S(   N(   RJ   R   RI   R$   R"   R)   R    R*   R   RQ   RO   RP   (   R&   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_smtplib.pyR+   ª   s
    c         C   s/   t  j t |  j d d d d ƒ} | j ƒ  d  S(   NR2   t	   localhostR   i   (   R,   R-   R.   R    t   quit(   R&   R/   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_smtplib.pyt	   testBasic´   s    !c         C   sK   t  j t |  j d d d d ƒ} d } |  j | j ƒ  | ƒ | j ƒ  d  S(   NR2   RX   R   i   iú   t   Ok(   iú   R[   (   R,   R-   R.   R    R4   t   noopRY   (   R&   R/   t   expected(    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_smtplib.pyt   testNOOP¹   s    !c         C   sK   t  j t |  j d d d d ƒ} d } |  j | j ƒ  | ƒ | j ƒ  d  S(   NR2   RX   R   i   iú   R[   (   iú   R[   (   R,   R-   R.   R    R4   t   rsetRY   (   R&   R/   R]   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_smtplib.pyt   testRSET¿   s    !c         C   sK   t  j t |  j d d d d ƒ} d } |  j | j ƒ  | ƒ | j ƒ  d  S(   NR2   RX   R   i   iö  s%   Error: command "EHLO" not implemented(   iö  s%   Error: command "EHLO" not implemented(   R,   R-   R.   R    R4   t   ehloRY   (   R&   R/   R]   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_smtplib.pyt   testNotImplementedÅ   s    !c         C   sg   t  j t |  j d d d d ƒ} d } |  j | j d ƒ | ƒ |  j | j d ƒ | ƒ | j ƒ  d  S(	   NR2   RX   R   i   iö  s%   Error: command "VRFY" not implementeds   nobody@nowhere.com(   iö  s%   Error: command "VRFY" not implemented(   R,   R-   R.   R    R4   t   vrfyt   verifyRY   (   R&   R/   R]   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_smtplib.pyt   testVRFYÌ   s
    !c         C   sU   t  j t |  j d d d d ƒ} | j ƒ  d } |  j | j ƒ  | ƒ | j ƒ  d  S(   NR2   RX   R   i   i÷  s   Duplicate HELO/EHLO(   i÷  s   Duplicate HELO/EHLO(   R,   R-   R.   R    t   heloR4   RY   (   R&   R/   R]   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_smtplib.pyt   testSecondHELOÔ   s
    !
c         C   sE   t  j t |  j d d d d ƒ} |  j | j ƒ  d ƒ | j ƒ  d  S(   NR2   RX   R   i   s%   Error: command "HELP" not implemented(   R,   R-   R.   R    R4   t   helpRY   (   R&   R/   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_smtplib.pyt   testHELPÝ   s    !c         C   s¨   d } t  j t |  j d d d d ƒ} | j d d | ƒ t j d ƒ | j ƒ  |  j j	 ƒ  |  j
 j ƒ  |  j j ƒ  d	 t | t f } |  j |  j j ƒ  | ƒ d  S(
   Ns   A test messageR2   RX   R   i   t   Johnt   Sallyg{®Gáz„?s   %s%s
%s(   R,   R-   R.   R    t   sendmailRF   RG   RY   RJ   R   RI   R$   RS   t   flusht	   MSG_BEGINt   MSG_ENDR4   t   getvalue(   R&   t   mR/   t   mexpect(    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_smtplib.pyt   testSendâ   s    !
(   R>   R?   R(   R+   RZ   R^   R`   Rb   Re   Rg   Ri   Rs   (    (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_smtplib.pyRM   ’   s   		
								t   NonConnectingTestsc           B   s   e  Z d  „  Z d „  Z RS(   c         C   s?   t  j ƒ  } |  j t  j | j ƒ |  j t  j | j d ƒ d  S(   Ns   test msg(   R,   R-   t   assertRaisest   SMTPServerDisconnectedRa   R   (   R&   R/   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_smtplib.pyt   testNotConnectedö   s    c         C   s9   |  j  t j t j d d ƒ |  j  t j t j d ƒ d  S(   NRX   t   boguss   localhost:bogus(   Ru   R   t   errorR,   R-   (   R&   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_smtplib.pyt   testNonnumericPort   s    
(   R>   R?   Rw   Rz   (    (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_smtplib.pyRt   ô   s   	
t   BadHELOServerTestsc           B   s#   e  Z d  „  Z d „  Z d „  Z RS(   c         C   sà   t  j |  _ t j ƒ  |  _ |  j t  _ t j ƒ  |  _ t j	 ƒ  |  _
 t j t j t j ƒ |  _ |  j j d ƒ t j |  j ƒ |  _ |  j
 d |  j f } t j d t d | ƒ |  _ |  j j ƒ  |  j
 j ƒ  |  j
 j ƒ  d  S(   Ni   s   199 no hello for you!
R   R   (   RO   RP   RQ   RR   RS   R    R   R   R   R   R	   R   R   R   R   R   R   R    R!   R   R"   R#   R$   R%   (   R&   R'   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_smtplib.pyR(     s    c         C   s:   |  j  j ƒ  |  j j ƒ  t j |  j Œ  |  j t _	 d  S(   N(
   R	   R$   R"   R)   R    R*   R   RQ   RO   RP   (   R&   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_smtplib.pyR+     s    c         C   s)   |  j  t j t j t |  j d d ƒ d  S(   NRX   i   (   Ru   R,   t   SMTPConnectErrorR-   R.   R    (   R&   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_smtplib.pyt   testFailingHELO"  s    (   R>   R?   R(   R+   R}   (    (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_smtplib.pyR{   	  s   		t   TooLongLineTestsc           B   s<   e  Z d  d e j d d Z d „  Z d „  Z d „  Z RS(   s   250 OKt   .i   s   
c         C   sÔ   t  j |  _ t j ƒ  |  _ |  j t  _ t j ƒ  |  _ t j t j	 t j
 ƒ |  _ |  j j d ƒ t j |  j ƒ |  _ |  j |  j |  j f } t j d t d | ƒ |  _ |  j j ƒ  |  j j ƒ  |  j j ƒ  d  S(   Ni   R   R   (   RO   RP   RQ   RR   RS   R   R   R	   R   R   R   R   R   R    R   R    t   respdataR!   R   R"   R#   R$   R%   (   R&   R'   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_smtplib.pyR(   +  s    c         C   s*   |  j  j ƒ  |  j j ƒ  |  j t _ d  S(   N(   R	   R$   R"   R)   RQ   RO   RP   (   R&   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_smtplib.pyR+   :  s    c         C   s)   |  j  t j t j t |  j d d ƒ d  S(   NRX   i   (   Ru   R,   t   SMTPResponseExceptionR-   R.   R    (   R&   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_smtplib.pyt   testLineTooLong?  s    (   R>   R?   R,   t   _MAXLINER€   R(   R+   R‚   (    (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_smtplib.pyR~   '  s   		s   John As   Mr.A@somewhere.coms   Sally Bs   Ms.B@somewhere.coms   Ruth Cs   Mrs.C@somewhereesle.comt   somepasswords<   PENCeUxFREJoU0NnbmhNWitOMjNGNndAZWx3b29kLmlubm9zb2Z0LmNvbT4=t   TXIuQUBzb21ld2hlcmUuY29tt   logins,   AE1yLkFAc29tZXdoZXJlLmNvbQBzb21lcGFzc3dvcmQ=t   plaintD   TXIUQUBZB21LD2HLCMUUY29TIDG4OWQ0MJKWZGQ4ODNMNDA4NTGXMDRLZWMYZJDMODG1s   cram-md5t   C29TZXBHC3N3B3JKs   list-1s   list-2t   SimSMTPChannelc           B   s>   e  Z d  „  Z d „  Z d „  Z d „  Z d „  Z d „  Z RS(   c         O   sH   d j  g  | D] } d j | ƒ ^ q ƒ |  _ t j j |  | | Ž d  S(   Nt    s	   250-{0}
(   R)   t   formatt   _extrafeaturesRT   t   SMTPChannelt   __init__(   R&   t   extra_featuresR   t   kwt   x(    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_smtplib.pyR�   [  s    (c         C   s(   d } | |  j  d } |  j | ƒ d  S(   NsH   250-testhost
250-EXPN
250-SIZE 20000000
250-STARTTLS
250-DELIVERBY
s   250 HELP(   R�   t   push(   R&   t   argt   resp(    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_smtplib.pyt	   smtp_EHLO`  s    c         C   sH   | t  k r3 |  j d t  | t j | ƒ f ƒ n |  j d | ƒ d  S(   Ns	   250 %s %ss   550 No such user: %s(   t	   sim_usersR“   R,   t	   quoteaddr(   R&   R”   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_smtplib.pyt	   smtp_VRFYi  s    'c         C   s±   | j  ƒ  } | t k r  t | } xˆ t | ƒ D]j \ } } t j | ƒ } | t | ƒ d k  r~ |  j d t | | f ƒ q/ |  j d t | | f ƒ q/ Wn |  j d ƒ d  S(   Ni   s	   250-%s %ss	   250 %s %ss   550 No access for you!(   t   lowert	   sim_listst	   enumerateR,   R˜   t   lenR“   R—   (   R&   R”   t	   list_namet	   user_listR   t
   user_emailt   quoted_addr(    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_smtplib.pyt	   smtp_EXPNp  s    
"c         C   sÖ   | j  ƒ  j ƒ  d k r2 |  j d j t ƒ ƒ d  S| j ƒ  \ } } | j ƒ  } | t k rm |  j d ƒ d  S| d k r™ | t d k r™ |  j d ƒ n9 | d k rÅ | t d k rÅ |  j d ƒ n |  j d ƒ d  S(	   Ns   cram-md5s   334 {0}s   504 auth type unimplementedR‡   s   235 plain auth okR†   s   334 Password:s   550 No access for you!(   t   stripRš   R“   RŒ   t   sim_cram_md5_challenget   splitt   sim_auth_credentials(   R&   R”   t   mecht   auth(    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_smtplib.pyt	   smtp_AUTH}  s    c         C   s   ‚  d  S(   N(    (   R&   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_smtplib.pyt   handle_error�  s    (   R>   R?   R�   R–   R™   R¢   R©   Rª   (    (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_smtplib.pyRŠ   Y  s   						t   SimSMTPServerc           B   s5   e  Z d  „  Z d „  Z d „  Z d „  Z d „  Z RS(   c         O   s#   g  |  _  t j j |  | | Ž d  S(   N(   t   _extra_featuresRT   t
   SMTPServerR�   (   R&   R   R‘   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_smtplib.pyR�   “  s    	c         C   s1   |  j  ƒ  \ } } t |  j |  | | ƒ |  _ d  S(   N(   R   RŠ   R¬   t   _SMTPchannel(   R&   R   R   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_smtplib.pyt   handle_accept—  s    	c         C   s   d  S(   N(    (   R&   t   peert   mailfromt   rcpttost   data(    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_smtplib.pyt   process_messageœ  s    c         C   s   |  j  j | ƒ d  S(   N(   R¬   t   append(   R&   t   feature(    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_smtplib.pyt   add_featureŸ  s    c         C   s   ‚  d  S(   N(    (   R&   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_smtplib.pyRª   ¢  s    (   R>   R?   R�   R¯   R´   R·   Rª   (    (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_smtplib.pyR«   ‘  s
   				t   SMTPSimTestsc           B   sb   e  Z d  „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 d	 „  Z RS(
   c         C   s¼   t  j ƒ  |  _ t j ƒ  |  _ t j ƒ  |  _ t t d f d ƒ |  _	 |  j	 j
 j ƒ  d |  _ |  j	 |  j |  j f } t j d t d | ƒ |  _ |  j j ƒ  |  j j ƒ  |  j j ƒ  d  S(   Ni    RN   iÿÿÿÿi   R   R   (   RN   iÿÿÿÿ(   R    R   R   R   R   RI   RJ   R«   R.   R   R   RV   R    R!   RL   R"   R#   R$   R%   (   R&   RW   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_smtplib.pyR(   «  s    c         C   s;   |  j  j ƒ  |  j j ƒ  |  j j ƒ  t j |  j Œ  d  S(   N(	   RJ   R   RI   R$   R"   R)   R    R*   R   (   R&   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_smtplib.pyR+   »  s    c         C   s/   t  j t |  j d d d d ƒ} | j ƒ  d  S(   NR2   RX   R   i   (   R,   R-   R.   R    RY   (   R&   R/   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_smtplib.pyRZ   Ã  s    !c         C   sÅ   t  j t |  j d d d d ƒ} |  j | j i  ƒ i d d 6d d 6d d	 6d d
 6d d 6} | j ƒ  |  j | j | ƒ x$ | D] } |  j | j | ƒ ƒ q� W|  j	 | j d ƒ ƒ | j
 ƒ  d  S(   NR2   RX   R   i   R‹   t   expnt   20000000t   sizet   starttlst	   deliverbyRh   s   unsupported-feature(   R,   R-   R.   R    R4   t   esmtp_featuresRa   t
   assertTruet   has_extnt   assertFalseRY   (   R&   R/   t   expected_featurest   k(    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_smtplib.pyt   testEHLOÈ  s    !


c         C   s³   t  j t |  j d d d d ƒ} xR t j ƒ  D]D \ } } d d | t  j | ƒ f f } |  j | j | ƒ | ƒ q. Wd } d d	 | f } |  j | j | ƒ | ƒ | j	 ƒ  d  S(
   NR2   RX   R   i   iú   s   %s %ss   nobody@nowhere.comi&  s   No such user: %s(
   R,   R-   R.   R    R—   t   itemsR˜   R4   Rc   RY   (   R&   R/   t   emailt   namet   expected_knownt   ut   expected_unknown(    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_smtplib.pyRe   Ý  s    !c   	      C   sÚ   t  j t |  j d d d d ƒ} xƒ t j ƒ  D]u \ } } g  } x2 | D]* } | j d t | t  j | ƒ f ƒ qG Wd d j	 | ƒ f } |  j
 | j | ƒ | ƒ q. Wd } d } |  j
 | j | ƒ | ƒ | j ƒ  d  S(   NR2   RX   R   i   s   %s %siú   s   
s   PSU-Members-Listi&  s   No access for you!(   i&  s   No access for you!(   R,   R-   R.   R    R›   RÅ   Rµ   R—   R˜   R)   R4   R¹   RY   (	   R&   R/   t   listnamet   memberst   usersRq   RÈ   RÉ   RÊ   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_smtplib.pyt   testEXPNé  s    !(c         C   s_   |  j  j d ƒ t j t |  j d d d d ƒ} d
 } |  j | j t d t d	 ƒ | ƒ d  S(   Ns
   AUTH PLAINR2   RX   R   i   ië   s   plain auth oki    i   (   ië   s   plain auth ok(	   R   R·   R,   R-   R.   R    R4   R†   t   sim_auth(   R&   R/   t   expected_auth_ok(    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_smtplib.pyt   testAUTH_PLAINø  s    !c         C   s…   |  j  j d ƒ t j t |  j d d d d ƒ} y | j t d t d ƒ Wn1 t j k
 r€ } t	 t
 | ƒ k r� d ‚ q� n Xd  S(	   Ns
   AUTH LOGINR2   RX   R   i   i    i   s4   expected encoded password not found in error message(   R   R·   R,   R-   R.   R    R†   RÏ   t   SMTPAuthenticationErrort   sim_auth_login_passwordt   str(   R&   R/   t   err(    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_smtplib.pyt   testAUTH_LOGIN  s    ! c         C   s‰   |  j  j d ƒ t j t |  j d d d d ƒ} y | j t d t d ƒ Wn5 t j k
 r„ } t	 d t
 | ƒ k r… d	 ‚ q… n Xd  S(
   Ns   AUTH CRAM-MD5R2   RX   R   i   i    i   s   cram-md5s7   expected encoded credentials not found in error message(   R   R·   R,   R-   R.   R    R†   RÏ   RÒ   R¦   RÔ   (   R&   R/   RÕ   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_smtplib.pyt   testAUTH_CRAM_MD5  s    ! c         C   sÄ   t  j t |  j d d d d ƒ} | j ƒ  \ } } |  j | d ƒ |  j d | j ƒ | j ƒ  |  j	 d | j ƒ | j
 t |  j ƒ |  j	 d | j ƒ | j ƒ  |  j d | j ƒ | j ƒ  d  S(   NR2   RX   R   i   iú   R»   (   R,   R-   R.   R    Ra   R4   t   assertInR¾   RY   t   assertNotInt   connectt   ehlo_or_helo_if_needed(   R&   R/   t   codet   message(    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_smtplib.pyt   test_quit_resets_greeting  s    	

(   R>   R?   R(   R+   RZ   RÄ   Re   RÎ   RÑ   RÖ   R×   RÞ   (    (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_smtplib.pyR¸   ¨  s   									c         C   s    t  j t t t t t t ƒ d  S(   N(   R    t   run_unittestR   RM   Rt   R{   R¸   R~   (   t   verbose(    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_smtplib.pyt	   test_main+  s    t   __main__(   s   Mr.A@somewhere.comR„   ()   RB   t   email.utilsRÆ   R   RT   R,   RR   RO   RF   R   t   unittestt   testR    R   t   ImportErrorR9   R.   R   t
   skipUnlesst   TestCaseR   RL   Rn   Ro   RM   Rt   R{   R~   R—   RÏ   R¤   R¦   RÓ   R›   RŽ   RŠ   R­   R«   R¸   Rá   R>   (    (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_smtplib.pyt   <module>   s^   
		>	a


8‚