ó
‹wÛjc           @   s¸  d  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 y d d l Z Wn e	 k
 rƒ d Z n Xd d l m Z m Z m Z d d l m Z d d l m Z m Z e j d ƒ Z d Z d d	 Z d
 Z d
 Z d e j f d „  ƒ  YZ d e j f d „  ƒ  YZ d e j e j f d „  ƒ  YZ e d k	 r÷e j  j! e j  j" e# ƒ d ƒ Z$ e j  j! e j  j" e# ƒ d ƒ Z% d e& e j f d „  ƒ  YZ' d e' e f d „  ƒ  YZ( d e' e f d „  ƒ  YZ) d e f d „  ƒ  YZ* n  d e f d „  ƒ  YZ+ e e j, d ƒ d e f d „  ƒ  Yƒ Z- e e d  ƒ d! e+ f d" „  ƒ  Yƒ Z. e e d  ƒ d# e f d$ „  ƒ  Yƒ Z/ d% e f d& „  ƒ  YZ0 d' „  Z1 e2 d( k r´e1 ƒ  n  d S()   s   Test script for ftplib module.iÿÿÿÿN(   t   TestCaset   SkipTestt
   skipUnless(   t   test_support(   t   HOSTt   HOSTv6t	   threadingi   s   abcde12345
iè  s
   foo
bar
t   DummyDTPHandlerc           B   s2   e  Z e Z d  „  Z d „  Z d „  Z d „  Z RS(   c         C   s,   t  j j |  | ƒ | |  _ d |  j _ d  S(   Nt    (   t   asynchatt
   async_chatt   __init__t	   baseclasst   last_received_data(   t   selft   connR   (    (    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_ftplib.pyR   "   s    	c         C   s   |  j  j |  j d ƒ 7_ d  S(   Ni   (   R   R   t   recv(   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_ftplib.pyt   handle_read'   s    c         C   s3   |  j  s/ |  j j d ƒ |  j ƒ  t |  _  n  d  S(   Ns   226 transfer complete(   t   dtp_conn_closedR   t   pusht   closet   True(   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_ftplib.pyt   handle_close*   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_ftplib.pyt   handle_error3   s    (   t   __name__t
   __module__t   FalseR   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_ftplib.pyR      s
   				t   DummyFTPHandlerc           B   s  e  Z e Z d  „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 d „  Z d „  Z d	 „  Z d
 „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z  RS(   c         C   sp   t  j j |  | ƒ |  j d ƒ g  |  _ d  |  _ d  |  _ d |  _ d |  _	 d  |  _
 t |  _ |  j d ƒ d  S(   Ns   
R   s   220 welcome(   R	   R
   R   t   set_terminatort	   in_buffert   Nonet   dtpt   last_received_cmdR   t   next_responset   restt	   RETR_DATAt   next_retr_dataR   (   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_ftplib.pyR   ;   s    							c         C   s   |  j  j | ƒ d  S(   N(   R   t   append(   R   t   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_ftplib.pyt   collect_incoming_dataG   s    c         C   sÜ   d j  |  j ƒ } g  |  _ |  j r@ |  j |  j ƒ d |  _ n  | j d ƒ d j ƒ  } | |  _ | j d ƒ } | d k rŽ | | d } n d } t |  d | ƒ rÇ t	 |  d | ƒ } | | ƒ n |  j d | ƒ d  S(   NR   t    i    iÿÿÿÿi   t   cmd_s    550 command "%s" not understood.(
   t   joinR   R!   R   t   splitt   lowerR    t   findt   hasattrt   getattr(   R   t   linet   cmdt   spacet   argt   method(    (    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_ftplib.pyt   found_terminatorJ   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_ftplib.pyR   ]   s    c         C   s   t  j j |  | d ƒ d  S(   Ns   
(   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_ftplib.pyR   `   s    c         C   s†   t  t | j d ƒ ƒ } d t | d  ƒ } | d d | d } t j | | f d d ƒ} |  j | d |  ƒ|  _ |  j d	 ƒ d  S(
   Nt   ,s   %d.%d.%d.%di   i   i   t   timeouti
   R   s&   200 active data connection established(	   t   mapt   intR+   t   tuplet   sockett   create_connectiont   dtp_handlerR   R   (   R   R3   t   addrt   ipt   portt   s(    (    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_ftplib.pyt   cmd_portc   s    c   	      C   sË   t  j  ƒ  } | j |  j  j ƒ  d d f ƒ | j d ƒ | j d ƒ | j ƒ  d  \ } } | j d d ƒ } t | d ƒ \ } } |  j d | | | f ƒ | j ƒ  \ } } |  j	 | d	 |  ƒ|  _
 d  S(
   Ni    i   i
   i   t   .R6   i   s$   227 entering passive mode (%s,%d,%d)R   (   R;   t   bindt   getsocknamet   listent
   settimeoutt   replacet   divmodR   t   acceptR=   R   (	   R   R3   t   sockR?   R@   t   p1t   p2R   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_ftplib.pyt   cmd_pasvk   s     c         C   ss   | j  | d ƒ d d !\ } } } t | ƒ } t j | | f d d ƒ} |  j | d |  ƒ|  _ |  j d ƒ d  S(   Ni    i   iÿÿÿÿR7   i
   R   s&   200 active data connection established(   R+   R9   R;   R<   R=   R   R   (   R   R3   t   afR?   R@   RA   (    (    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_ftplib.pyt   cmd_eprtw   s
    #c         C   s›   t  j  t  j ƒ } | j |  j  j ƒ  d d f ƒ | j d ƒ | j d ƒ | j ƒ  d } |  j d | ƒ | j ƒ  \ } } |  j | d |  ƒ|  _	 d  S(   Ni    i   i
   i   s+   229 entering extended passive mode (|||%d|)R   (
   R;   t   AF_INET6RD   RE   RF   RG   R   RJ   R=   R   (   R   R3   RK   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_ftplib.pyt   cmd_epsv~   s     c         C   s   |  j  | ƒ d  S(   N(   R   (   R   R3   (    (    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_ftplib.pyt   cmd_echoˆ   s    c         C   s   |  j  d ƒ d  S(   Ns   331 username ok(   R   (   R   R3   (    (    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_ftplib.pyt   cmd_userŒ   s    c         C   s   |  j  d ƒ d  S(   Ns   230 password ok(   R   (   R   R3   (    (    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_ftplib.pyt   cmd_pass�   s    c         C   s   |  j  d ƒ d  S(   Ns   230 acct ok(   R   (   R   R3   (    (    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_ftplib.pyt   cmd_acct’   s    c         C   s   |  j  d ƒ d  S(   Ns   350 rnfr ok(   R   (   R   R3   (    (    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_ftplib.pyt   cmd_rnfr•   s    c         C   s   |  j  d ƒ d  S(   Ns   250 rnto ok(   R   (   R   R3   (    (    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_ftplib.pyt   cmd_rnto˜   s    c         C   s   |  j  d ƒ d  S(   Ns   250 dele ok(   R   (   R   R3   (    (    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_ftplib.pyt   cmd_dele›   s    c         C   s   |  j  d ƒ d  S(   Ns
   250 cwd ok(   R   (   R   R3   (    (    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_ftplib.pyt   cmd_cwdž   s    c         C   s   |  j  d ƒ d  S(   Ns   250 1000(   R   (   R   R3   (    (    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_ftplib.pyt   cmd_size¡   s    c         C   s   |  j  d | ƒ d  S(   Ns   257 "%s"(   R   (   R   R3   (    (    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_ftplib.pyt   cmd_mkd¤   s    c         C   s   |  j  d ƒ d  S(   Ns
   250 rmd ok(   R   (   R   R3   (    (    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_ftplib.pyt   cmd_rmd§   s    c         C   s   |  j  d ƒ d  S(   Ns   257 "pwd ok"(   R   (   R   R3   (    (    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_ftplib.pyt   cmd_pwdª   s    c         C   s   |  j  d ƒ d  S(   Ns   200 type ok(   R   (   R   R3   (    (    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_ftplib.pyt   cmd_type­   s    c         C   s   |  j  d ƒ |  j ƒ  d  S(   Ns   221 quit ok(   R   R   (   R   R3   (    (    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_ftplib.pyt   cmd_quit°   s    c         C   s   |  j  d ƒ d  S(   Ns   125 stor ok(   R   (   R   R3   (    (    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_ftplib.pyt   cmd_stor´   s    c         C   s   | |  _  |  j d ƒ d  S(   Ns   350 rest ok(   R"   R   (   R   R3   (    (    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_ftplib.pyt   cmd_rest·   s    	c         C   se   |  j  d ƒ |  j d  k	 r. t |  j ƒ } n d } |  j j  |  j | ƒ |  j j ƒ  d  |  _ d  S(   Ns   125 retr oki    (   R   R"   R   R9   R   R$   t   close_when_done(   R   R3   t   offset(    (    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_ftplib.pyt   cmd_retr»   s    c         C   s.   |  j  d ƒ |  j j  t ƒ |  j j ƒ  d  S(   Ns   125 list ok(   R   R   t	   LIST_DATARc   (   R   R3   (    (    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_ftplib.pyt   cmd_listÅ   s    c         C   s.   |  j  d ƒ |  j j  t ƒ |  j j ƒ  d  S(   Ns   125 nlst ok(   R   R   t	   NLST_DATARc   (   R   R3   (    (    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_ftplib.pyt   cmd_nlstÊ   s    c         C   s$   d t  | ƒ |  _ |  j d ƒ d  S(   Nt   xs   125 setlongretr ok(   R9   R$   R   (   R   R3   (    (    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_ftplib.pyt   cmd_setlongretrÏ   s    (!   R   R   R   R=   R   R'   R5   R   R   RB   RN   RP   RR   RS   RT   RU   RV   RW   RX   RY   RZ   R[   R\   R]   R^   R_   R`   Ra   Rb   Re   Rg   Ri   Rk   (    (    (    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_ftplib.pyR   7   s<   									
																	
		t   DummyFTPServerc           B   sb   e  Z e Z e j d  „ Z d „  Z d „  Z d „  Z	 d „  Z
 d „  Z e Z d „  Z d „  Z RS(   c         C   s¬   t  j j |  ƒ t j j |  ƒ |  j | t j ƒ y^ |  j | ƒ |  j	 d ƒ t
 |  _ t  j ƒ  |  _ |  j j ƒ  d  \ |  _ |  _ d  |  _ Wn |  j ƒ  ‚  n Xd  S(   Ni   i   (   R   t   ThreadR   t   asyncoret
   dispatchert   create_socketR;   t   SOCK_STREAMRD   RF   R   t   activet   Lockt   active_lockRE   t   hostR@   R   t   handler_instancet   del_channel(   R   t   addressRO   (    (    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_ftplib.pyR   Ù   s    	
c         C   s0   t  j ƒ  |  _ t  j j |  ƒ |  j j ƒ  d  S(   N(   R   t   Eventt   _DummyFTPServer__flagRm   t   startt   wait(   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_ftplib.pyR{   ê   s    c         C   ss   t  |  _ |  j j ƒ  xF |  j r^ t j r^ |  j j ƒ  t j d d d d ƒ |  j j	 ƒ  q Wt j
 d t  ƒ d  S(   NR7   gš™™™™™¹?t   counti   t
   ignore_all(   R   Rr   Rz   t   setRn   t
   socket_mapRt   t   acquiret   loopt   releaset	   close_all(   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_ftplib.pyt   runð   s    	c         C   s   t  |  _ |  j ƒ  d  S(   N(   R   Rr   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_ftplib.pyt   stopù   s    	c         C   s(   |  j  ƒ  \ } } |  j | ƒ |  _ d  S(   N(   RJ   t   handlerRv   (   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_ftplib.pyt   handle_acceptþ   s    c         C   s   |  j  ƒ  d  S(   N(   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_ftplib.pyt   handle_connect  s    c         C   s   d S(   Ni    (    (   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_ftplib.pyt   writable  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_ftplib.pyR   	  s    (   R   R   R   R‡   R;   t   AF_INETR   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_ftplib.pyRl   Õ   s   							s   keycert3.pems   pycacert.pemt   SSLConnectionc           B   sk   e  Z d  Z e Z e Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 d „  Z d „  Z d „  Z d	 „  Z RS(
   s3   An asyncore.dispatcher subclass supporting TLS/SSL.c         C   sW   t  j |  j d t d t d t d t d t  j ƒ} |  j ƒ  |  j | ƒ t |  _	 d  S(   Nt   suppress_ragged_eofst   certfilet   server_sidet   do_handshake_on_connectt   ssl_version(
   t   sslt   wrap_socketR;   R   t   CERTFILER   t   PROTOCOL_SSLv23Rw   t
   set_sockett   _ssl_accepting(   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_ftplib.pyt   secure_connection  s    
c         C   s²   y |  j  j ƒ  Wn‘ t j k
 ro } | j d t j t j f k rI d  S| j d t j k ri |  j ƒ  S‚  n? t  j	 k
 r¤ } | j d t
 j k r® |  j ƒ  Sn
 Xt |  _ d  S(   Ni    (   R;   t   do_handshakeR’   t   SSLErrort   argst   SSL_ERROR_WANT_READt   SSL_ERROR_WANT_WRITEt   SSL_ERROR_EOFR   t   errort   errnot   ECONNABORTEDR   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_ftplib.pyt   _do_ssl_handshake!  s    
c         C   s«   t  |  _ y |  j j ƒ  |  _ WnN t j k
 rZ } | j d t j t j f k rp d  Sn t j	 k
 ro } n Xt
 |  _ t |  d t
 ƒ t
 k r§ t t |  ƒ j ƒ  n  d  S(   Ni    t   _ccc(   R   t   _ssl_closingR;   t   unwrapR’   Rš   R›   Rœ   R�   RŸ   R   R/   t   superRŒ   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_ftplib.pyt   _do_ssl_shutdown1  s    		c         C   sC   |  j  r |  j ƒ  n) |  j r, |  j ƒ  n t t |  ƒ j ƒ  d  S(   N(   R—   R£   R¥   R¨   R§   RŒ   t   handle_read_event(   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_ftplib.pyR©   E  s
    		c         C   sC   |  j  r |  j ƒ  n) |  j r, |  j ƒ  n t t |  ƒ j ƒ  d  S(   N(   R—   R£   R¥   R¨   R§   RŒ   t   handle_write_event(   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_ftplib.pyRª   M  s
    		c         C   si   y t  t |  ƒ j | ƒ SWnH t j k
 rd } | j d t j t j t j t j	 f k r^ d S‚  n Xd  S(   Ni    (
   R§   RŒ   t   sendR’   Rš   R›   Rž   t   SSL_ERROR_ZERO_RETURNRœ   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_ftplib.pyR«   U  s    c         C   sŠ   y t  t |  ƒ j | ƒ SWni t j k
 r… } | j d t j t j f k rR d S| j d t j t j	 f k r |  j
 ƒ  d S‚  n Xd  S(   Ni    R   (   R§   RŒ   R   R’   Rš   R›   Rœ   R�   Rž   R¬   R   (   R   t   buffer_sizeR¢   (    (    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_ftplib.pyR   _  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_ftplib.pyR   k  s    c         C   sK   t  |  j t j ƒ r4 |  j j d  k	 r4 |  j ƒ  n t t |  ƒ j	 ƒ  d  S(   N(
   t
   isinstanceR;   R’   t	   SSLSockett   _sslobjR   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_ftplib.pyR   n  s    (   R   R   t   __doc__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_ftplib.pyRŒ     s   							
		t   DummyTLS_DTPHandlerc           B   s   e  Z d  Z d „  Z RS(   s.   A DummyDTPHandler subclass supporting TLS/SSL.c         C   s0   t  j |  | | ƒ |  j j r, |  j ƒ  n  d  S(   N(   R   R   R   t   secure_data_channelR˜   (   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_ftplib.pyR   y  s    (   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_ftplib.pyR²   v  s   t   DummyTLS_FTPHandlerc           B   s8   e  Z d  Z e Z d „  Z d „  Z d „  Z d „  Z RS(   s.   A DummyFTPHandler subclass supporting TLS/SSL.c         C   s   t  j |  | ƒ t |  _ d  S(   N(   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_ftplib.pyR   „  s    c         C   s   |  j  d ƒ |  j ƒ  d S(   s   Set up secure control channel.s   234 AUTH TLS successfulN(   R   R˜   (   R   R0   (    (    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_ftplib.pyt   cmd_authˆ  s    c         C   s   |  j  d ƒ d S(   s»   Negotiate size of buffer for secure data transfer.
            For TLS/SSL the only valid value for the parameter is '0'.
            Any other value is accepted but ignored.
            s   200 PBSZ=0 successful.N(   R   (   R   R0   (    (    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_ftplib.pyt   cmd_pbsz�  s    c         C   sg   | j  ƒ  } | d k r1 |  j d ƒ t |  _ n2 | d k rV |  j d ƒ t |  _ n |  j d ƒ d S(   s   Setup un/secure data channel.t   Cs   200 Protection set to Cleart   Ps   200 Protection set to Privates(   502 Unrecognized PROT type (use C or P).N(   t   upperR   R   R³   R   (   R   R0   R3   (    (    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_ftplib.pyt   cmd_prot”  s    (	   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_ftplib.pyR´     s   			t   DummyTLS_FTPServerc           B   s   e  Z e Z RS(    (   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_ftplib.pyR»   ¡  s   t   TestFTPClassc           B   s  e  Z d  „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 d	 „  Z d
 „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z  RS(   c         C   sZ   t  t d f ƒ |  _ |  j j ƒ  t j d d ƒ |  _ |  j j |  j j |  j j	 ƒ d  S(   Ni    R7   i
   (
   Rl   R   t   serverR{   t   ftplibt   FTPt   clientt   connectRu   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_ftplib.pyt   setUp§  s    c         C   s   |  j  j ƒ  |  j j ƒ  d  S(   N(   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_ftplib.pyt   tearDown­  s    c         C   s   |  j  |  j j ƒ  d ƒ d  S(   Ns   220 welcome(   t   assertEqualRÀ   t
   getwelcome(   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_ftplib.pyt   test_getwelcome±  s    c         C   sj   |  j  |  j j d ƒ t d ƒ ƒ |  j  |  j j d ƒ t d ƒ ƒ |  j  |  j j d ƒ t d ƒ ƒ d  S(   Nt   foos
   pass 12345s
   pass *****s
   PASS 12345s
   PASS *****(   RÄ   RÀ   t   sanitizet   repr(   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_ftplib.pyt   test_sanitize´  s    ""c         C   sÛ   |  j  t |  j j d ƒ |  j  t |  j j d ƒ |  j  t |  j j d ƒ |  j  t j |  j j d ƒ |  j  t j |  j j d ƒ |  j  t j |  j j d ƒ |  j  t j |  j j d ƒ |  j  t j |  j j d ƒ d  S(	   Ns
   echo 40
0s	   echo 40
0s	   echo 400s   echo 400s   echo 499s   echo 500s   echo 599s   echo 999(   t   assertRaisest
   ValueErrorRÀ   t   sendcmdR¾   t
   error_tempt
   error_permt   error_proto(   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_ftplib.pyt   test_exceptions¹  s    c         C   sf   t  j t  j t  j t  j t  j t t f } x5 | D]- } y | d ƒ ‚ Wq1 t  j k
 r] q1 Xq1 Wd  S(   Ns(   exception not included in all_errors set(	   R¾   t   error_replyRÎ   RÏ   RÐ   t   Errort   IOErrort   EOFErrort
   all_errors(   R   t
   exceptionsRj   (    (    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_ftplib.pyt   test_all_errorsÃ  s    c         C   s]   |  j  |  j j ƒ |  j j t ƒ |  j  |  j j ƒ |  j j t ƒ |  j |  j j ƒ d  S(   N(   t
   assertTrueRÀ   t   passiveservert   set_pasvR   R   t   assertFalse(   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_ftplib.pyt   test_set_pasvÌ  s
    c         C   s\   |  j  j d ƒ |  j  j d ƒ |  j t j |  j  j d ƒ |  j t j |  j  j d ƒ d  S(   Ns   echo 200s   echo 299s   echo 199s   echo 300(   RÀ   t   voidcmdRË   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_ftplib.pyt   test_voidcmdÔ  s    c         C   s   |  j  j ƒ  d  S(   N(   RÀ   t   login(   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_ftplib.pyt
   test_loginÚ  s    c         C   s   |  j  j d ƒ d  S(   Nt   passwd(   RÀ   t   acct(   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_ftplib.pyt	   test_acctÝ  s    c         C   sE   |  j  j d d ƒ d |  j j _ |  j t j |  j  j d d ƒ d  S(   Nt   at   bt   200(   RÀ   t   renameR½   Rv   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_ftplib.pyt   test_renameà  s    c         C   s?   |  j  j d ƒ d |  j j _ |  j t j |  j  j d ƒ d  S(   NRÇ   t   199(   RÀ   t   deleteR½   Rv   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_ftplib.pyt   test_deleteå  s    c         C   s   |  j  j d ƒ d  S(   NRÇ   (   RÀ   t   size(   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_ftplib.pyt	   test_sizeê  s    c         C   s&   |  j  j d ƒ } |  j | d ƒ d  S(   Ns   /foo(   RÀ   t   mkdRÄ   (   R   t   dir(    (    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_ftplib.pyt   test_mkdí  s    c         C   s   |  j  j d ƒ d  S(   NRÇ   (   RÀ   t   rmd(   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_ftplib.pyt   test_rmdñ  s    c         C   s&   |  j  j d ƒ } |  j | d ƒ d  S(   Ns   /foos
   250 cwd ok(   RÀ   t   cwdRÄ   (   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_ftplib.pyt   test_cwdô  s    c         C   s#   |  j  j ƒ  } |  j | d ƒ d  S(   Ns   pwd ok(   RÀ   t   pwdRÄ   (   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_ftplib.pyt   test_pwdø  s    c         C   s3   |  j  |  j j ƒ  d ƒ |  j  |  j j d  ƒ d  S(   Ns   221 quit ok(   RÄ   RÀ   t   quitRK   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_ftplib.pyt	   test_quitü  s    c         C   s9   g  } |  j  j d | j ƒ |  j d j | ƒ t ƒ d  S(   Nt   retrR   (   RÀ   t
   retrbinaryR%   RÄ   R*   R#   (   R   t   received(    (    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_ftplib.pyt   test_retrbinary  s    c         C   s€   xy d	 D]q } g  } |  j  j d | j d | ƒ|  j d j | ƒ t | d d | t d j | ƒ ƒ t t | ƒ f ƒq Wd  S(
   Ni    i
   i   Rú   R"   R   t   msgs   rest test case %d %d %d(   i    i
   i   (   RÀ   Rû   R%   RÄ   R*   R#   t   len(   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_ftplib.pyt   test_retrbinary_rest  s    c         C   sE   g  } |  j  j d | j ƒ |  j d j | ƒ t j d d ƒ ƒ d  S(   NRú   R   s   
(   RÀ   t	   retrlinesR%   RÄ   R*   R#   RH   (   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_ftplib.pyt   test_retrlines  s    c            s�   t  j  t ƒ } |  j j d | ƒ |  j |  j j j t ƒ g  ‰  | j d ƒ |  j j d | d ‡  f d †  ƒ|  j	 ˆ  ƒ d  S(   Nt   stori    t   callbackc            s   ˆ  j  d  ƒ S(   N(   R%   R   (   Rj   (   t   flag(    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_ftplib.pyt   <lambda>  R   (
   t   StringIOR#   RÀ   t
   storbinaryRÄ   R½   Rv   R   t   seekRÙ   (   R   t   f(    (   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_ftplib.pyt   test_storbinary  s    "c         C   si   t  j  t ƒ } xS d D]K } | j d ƒ |  j j d | d | ƒ|  j |  j j j t	 | ƒ ƒ q Wd  S(   Ni   t   30i    R  R"   (   i   R  (
   R  R#   R	  RÀ   R  RÄ   R½   Rv   R"   t   str(   R   R
  t   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_ftplib.pyt   test_storbinary_rest  s
    c            s�   t  j  t j d d ƒ ƒ } |  j j d | ƒ |  j |  j j j t ƒ g  ‰  | j	 d ƒ |  j j d | d ‡  f d †  ƒ|  j
 ˆ  ƒ d  S(   Ns   
s   
R  i    s   stor fooR  c            s   ˆ  j  d  ƒ S(   N(   R%   R   (   Rj   (   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_ftplib.pyR  ,  R   (   R  R#   RH   RÀ   t	   storlinesRÄ   R½   Rv   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_ftplib.pyt   test_storlines%  s    "c         C   s7   |  j  j ƒ  |  j |  j  j ƒ  t j d ƒ d  ƒ d  S(   Ns   
iÿÿÿÿ(   RÀ   t   nlstRÄ   Rh   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_ftplib.pyt	   test_nlst/  s    c            sH   g  ‰  |  j  j ‡  f d †  ƒ |  j d j ˆ  ƒ t j d d ƒ ƒ d  S(   Nc            s   ˆ  j  |  ƒ S(   N(   R%   (   Rj   (   t   l(    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_ftplib.pyR  5  R   R   s   
(   RÀ   Rð   RÄ   R*   Rf   RH   (   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_ftplib.pyt   test_dir3  s    c         C   s*   |  j  j ƒ  |  j |  j j j d ƒ d  S(   NR@   (   RÀ   t   makeportRÄ   R½   Rv   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_ftplib.pyt   test_makeport8  s    c         C   sT   |  j  j ƒ  \ } } t j | | f d ƒ } | j ƒ  |  j |  j j j d ƒ d  S(   Ni
   t   pasv(	   RÀ   t   makepasvR;   R<   R   RÄ   R½   Rv   R    (   R   Ru   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_ftplib.pyt   test_makepasv=  s    
c         C   s.   |  j  t j |  j j d |  j j d ƒ d  S(   NRj   i   (   RË   R¾   RÓ   RÀ   RÍ   t   maxline(   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_ftplib.pyt   test_line_too_longD  s    c         C   sJ   |  j  j d |  j  j d ƒ g  } |  j t j |  j  j d | j ƒ d  S(   Ns   SETLONGRETR %di   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_ftplib.pyt   test_retrlines_too_longH  s    c         C   s@   t  j  d |  j j d ƒ } |  j t j |  j j d | ƒ d  S(   NRj   i   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_ftplib.pyt   test_storlines_too_longN  s    (!   R   R   RÂ   RÃ   RÆ   RÊ   RÑ   RØ   RÝ   Rß   Rá   Rä   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_ftplib.pyR¼   ¥  s>   					
																			
		
						s   IPv6 not enabledt   TestIPv6Environmentc           B   sM   e  Z e d  „  ƒ Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 RS(   c         C   sD   y t  t d f d t j ƒWn  t j k
 r? t d ƒ ‚ n Xd  S(   Ni    RO   s   IPv6 not enabled(   Rl   R   R;   RQ   RŸ   R   (   t   cls(    (    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_ftplib.pyt
   setUpClassV  s    c         C   s]   t  t d f d t j ƒ|  _ |  j j ƒ  t j ƒ  |  _ |  j j	 |  j j
 |  j j ƒ d  S(   Ni    RO   (   Rl   R   R;   RQ   R½   R{   R¾   R¿   RÀ   RÁ   Ru   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_ftplib.pyRÂ   ]  s    c         C   s   |  j  j ƒ  |  j j ƒ  d  S(   N(   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_ftplib.pyRÃ   c  s    c         C   s   |  j  |  j j t j ƒ d  S(   N(   RÄ   RÀ   RO   R;   RQ   (   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_ftplib.pyt   test_afg  s    c         C   s*   |  j  j ƒ  |  j |  j j j d ƒ d  S(   Nt   eprt(   RÀ   R  RÄ   R½   Rv   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_ftplib.pyR  j  s    c         C   sT   |  j  j ƒ  \ } } t j | | f d ƒ } | j ƒ  |  j |  j j j d ƒ d  S(   Ni
   t   epsv(	   RÀ   R  R;   R<   R   RÄ   R½   Rv   R    (   R   Ru   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_ftplib.pyR  n  s    
c            sA   ‡  f d †  } ˆ  j  j t ƒ | ƒ  ˆ  j  j t ƒ | ƒ  d  S(   Nc             s9   g  }  ˆ  j  j d |  j ƒ ˆ  j d j |  ƒ t ƒ d  S(   NRú   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_ftplib.pyRú   u  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_ftplib.pyt   test_transfert  s
    (
   R   R   t   classmethodR!  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_ftplib.pyR  S  s   					s   SSL not availablet   TestTLS_FTPClassMixinc           B   s   e  Z d  Z d „  Z RS(   sf   Repeat TestFTPClass tests starting the TLS layer for both control
    and data connections first.
    c         C   st   t  t d f ƒ |  _ |  j j ƒ  t j d d ƒ |  _ |  j j |  j j |  j j	 ƒ |  j j
 ƒ  |  j j ƒ  d  S(   Ni    R7   i
   (   R»   R   R½   R{   R¾   t   FTP_TLSRÀ   RÁ   Ru   R@   t   autht   prot_p(   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_ftplib.pyRÂ   …  s    (   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_ftplib.pyR'    s   t   TestTLS_FTPClassc           B   s_   e  Z d  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 d	 „  Z RS(
   s   Specific TLS_FTP class tests.c         C   sZ   t  t d f ƒ |  _ |  j j ƒ  t j d t ƒ |  _ |  j j |  j j	 |  j j
 ƒ d  S(   Ni    R7   (   R»   R   R½   R{   R¾   R(  t   TIMEOUTRÀ   RÁ   Ru   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_ftplib.pyRÂ   “  s    c         C   s   |  j  j ƒ  |  j j ƒ  d  S(   N(   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_ftplib.pyRÃ   ™  s    c         C   sC   |  j  |  j j t j ƒ |  j j ƒ  |  j |  j j t j ƒ d  S(   N(   t   assertNotIsInstanceRÀ   RK   R’   R¯   R)  t   assertIsInstance(   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_ftplib.pyt   test_control_connection�  s    c         C   s\  |  j  j d ƒ } |  j | t j ƒ |  j | j d ƒ t j d ƒ ƒ | j	 ƒ  |  j |  j  j
 ƒ  d ƒ |  j  j ƒ  |  j  j d ƒ } |  j | t j ƒ |  j | j d ƒ t j d ƒ ƒ | j	 ƒ  |  j |  j  j
 ƒ  d ƒ |  j  j ƒ  |  j  j d ƒ } |  j | t j ƒ |  j | j d ƒ t j d ƒ ƒ | j	 ƒ  |  j |  j  j
 ƒ  d ƒ d  S(   Nt   listi   t   asciis   226 transfer complete(   RÀ   t   transfercmdR-  R’   R¯   RÄ   R   Rf   t   encodeR   t   voidrespR*  R.  t   prot_c(   R   RK   (    (    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_ftplib.pyt   test_data_connection¢  s"    "
"
"
c         C   sP   |  j  |  j j t j ƒ |  j j ƒ  |  j |  j j t j ƒ |  j j ƒ  d  S(   N(   R-  RÀ   RK   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_ftplib.pyRá   ¼  s    c         C   s'   |  j  j ƒ  |  j t |  j  j ƒ d  S(   N(   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_ftplib.pyt   test_auth_issued_twiceÄ  s    c         C   sM   z6 t  j |  j _ |  j j ƒ  |  j t |  j j ƒ Wd  t  j |  j _ Xd  S(   N(   R’   R•   RÀ   R‘   R)  RË   RÌ   t   PROTOCOL_TLS(   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_ftplib.pyt   test_auth_sslÈ  s
    c      	   C   so  |  j  j ƒ  t j t j ƒ } |  j t t j d t	 d | ƒ|  j t t j d t	 d | ƒ|  j t t j d t	 d t	 d | ƒt j d | d t
 ƒ |  _  |  j  j |  j j |  j j ƒ |  j |  j  j t j ƒ |  j  j ƒ  |  j |  j  j j | ƒ |  j |  j  j t j ƒ |  j  j ƒ  |  j  j d ƒ } z* |  j | j | ƒ |  j | t j ƒ Wd  | j ƒ  Xd  S(   Nt   keyfilet   contextRŽ   R7   R0  (   RÀ   Rø   R’   t
   SSLContextR8  RË   RÌ   R¾   R(  R”   R,  RÁ   R½   Ru   R@   R-  RK   R¯   R)  t   assertIsR;  R.  R*  R2  R   (   R   t   ctxRK   (    (    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_ftplib.pyt   test_contextÐ  s(    c         C   s|  |  j  j ƒ  t j t j ƒ } t j | _ t | _ | j	 t
 ƒ t j d | d t ƒ |  _  |  j  j |  j j |  j j ƒ |  j t j ƒ � |  j  j ƒ  Wd  QX|  j  j |  j j |  j j ƒ |  j  j ƒ  |  j t j ƒ � |  j  j d ƒ j ƒ  Wd  QX|  j  j ƒ  |  j  j d |  j j ƒ |  j  j ƒ  |  j  j ƒ  |  j  j d |  j j ƒ |  j  j ƒ  |  j  j d ƒ j ƒ  d  S(   NR;  R7   R0  t	   localhost(   RÀ   Rø   R’   R<  R8  t   CERT_REQUIREDt   verify_modeR   t   check_hostnamet   load_verify_locationst   CAFILER¾   R(  R,  RÁ   R½   Ru   R@   RË   t   CertificateErrorR)  R*  R2  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_ftplib.pyt   test_check_hostnameé  s(    	(   R   R   R±   RÂ   RÃ   R/  R6  Rá   R7  R9  R?  RG  (    (    (    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_ftplib.pyR+  �  s   								t   TestTimeoutsc           B   sY   e  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 j ƒ |  _ |  j j d ƒ t j	 |  j ƒ |  _
 t  j d |  j d |  j |  j f ƒ j ƒ  |  j j ƒ  |  j j ƒ  |  j
 t j _
 d  S(   Ni
   t   targetR›   (   R   Ry   t   evtR;   R‹   Rq   RK   RG   R   t	   bind_portR@   Rm   R½   R{   R|   t   clearR¾   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_ftplib.pyRÂ     s    +c         C   s   |  j  j ƒ  d  S(   N(   RJ  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_ftplib.pyRÃ     s    c         C   s…   | j  d ƒ | j ƒ  zR y | j ƒ  \ } } Wn t j k
 rF n" X| j d ƒ | j ƒ  | j ƒ  Wd  | j ƒ  | j ƒ  Xd  S(   Ni   s   1 Hola mundo
(   RF   R   RJ   R;   R7   R«   R   (   R   RJ  t   servR   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_ftplib.pyR½     s    
 

c         C   sx   |  j  t j ƒ  ƒ t j d ƒ z t j t ƒ } Wd  t j d  ƒ X|  j | j	 j
 ƒ  d ƒ |  j j ƒ  | j ƒ  d  S(   Ni   (   t   assertIsNoneR;   t   getdefaulttimeoutt   setdefaulttimeoutR¾   R¿   R   R   RÄ   RK   t
   gettimeoutRJ  R|   R   (   R   t   ftp(    (    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_ftplib.pyt   testTimeoutDefault,  s    c         C   s{   |  j  t j ƒ  ƒ t j d ƒ z t j t d d  ƒ} Wd  t j d  ƒ X|  j  | j j	 ƒ  ƒ |  j
 j ƒ  | j ƒ  d  S(   Ni   R7   (   RN  R;   RO  RP  R¾   R¿   R   R   RK   RQ  RJ  R|   R   (   R   RR  (    (    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_ftplib.pyt   testTimeoutNone8  s    c         C   sI   t  j t d d ƒ} |  j | j j ƒ  d ƒ |  j j ƒ  | j ƒ  d  S(   NR7   i   (	   R¾   R¿   R   RÄ   RK   RQ  RJ  R|   R   (   R   RR  (    (    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_ftplib.pyt   testTimeoutValueD  s    c         C   sS   t  j ƒ  } | j t d d ƒ|  j | j j ƒ  d ƒ |  j j ƒ  | j	 ƒ  d  S(   NR7   i   (
   R¾   R¿   RÁ   R   RÄ   RK   RQ  RJ  R|   R   (   R   RR  (    (    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_ftplib.pyt   testTimeoutConnectK  s
    c         C   sS   t  j d d ƒ } | j t ƒ |  j | j j ƒ  d ƒ |  j j ƒ  | j	 ƒ  d  S(   NR7   i   (
   R¾   R¿   RÁ   R   RÄ   RK   RQ  RJ  R|   R   (   R   RR  (    (    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_ftplib.pyt   testTimeoutDifferentOrderR  s
    c         C   sV   t  j ƒ  } d | _ | j t ƒ |  j | j j ƒ  d ƒ |  j j	 ƒ  | j
 ƒ  d  S(   Ni   (   R¾   R¿   R7   RÁ   R   RÄ   RK   RQ  RJ  R|   R   (   R   RR  (    (    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_ftplib.pyt   testTimeoutDirectAccessY  s    	(   R   R   RÂ   RÃ   R½   RS  RT  RU  RV  RW  RX  (    (    (    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_ftplib.pyRH    s   								c          C   sG   t  t t t t g }  t j ƒ  } z t j |  Œ  Wd  t j | Œ  Xd  S(   N(	   R¼   RH  R  R'  R+  R   t   threading_setupt   run_unittestt   threading_cleanup(   t   testst   thread_info(    (    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_ftplib.pyt	   test_mainb  s    t   __main__(3   R±   R¾   Rn   R	   R;   R  R    t   osR’   t   ImportErrorR   t   unittestR    R   R   t   testR   t   test.test_supportR   R   t   import_moduleR   R,  R#   Rf   Rh   R
   R   R   Ro   Rm   Rl   t   pathR*   t   dirnamet   __file__R”   RE  t   objectRŒ   R²   R´   R»   R¼   t   has_ipv6R  R'  R+  RH  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_ftplib.pyt   <module>   sP   

ž8!!d	"®+v\	