ó
ŒwÛjc           @   s5  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 d  d l m Z e j d ƒ Z	 e j
 Z
 e ƒ  Z d d „ Z d e f d „  ƒ  YZ d „  Z d	 „  Z d
 e f d „  ƒ  YZ d e f d „  ƒ  YZ e Z d e f d „  ƒ  YZ d e f d „  ƒ  YZ d d „ Z e d k r1e ƒ  n  d S(   iÿÿÿÿN(   t   TestCase(   t   test_supportt	   threadingc   	      C   sû   | j  d ƒ |  j ƒ  zÒ y· | j ƒ  \ } } | rÆ d } | j t d ƒ } | j ƒ  xl | D]a } | t k rt Pn  t | ƒ t t	 g k rœ t
 j | ƒ n
 | | 7} | j | ƒ } | | } q^ Wn  | j ƒ  Wn t j k
 rç n XWd | j ƒ  Xd S(   sÎ    Open a tcp server in three steps
        1) set evt to true to let the parent know we are ready
        2) [optional] if is not False, write the list of data from dataq.get()
           to the socket.
    i   t    g      à?N(   t   listent   sett   acceptt   gett   Truet	   task_donet	   EOF_sigilt   typet   intt   floatt   timet   sleept   sendt   closet   sockett   timeout(	   t   evtt   servt   dataqt   connt   addrt   datat   new_datat   itemt   written(    (    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_telnetlib.pyt   server   s*    
 

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 ƒ |  _ |  j j d ƒ t j	 |  j ƒ |  _
 t  j d t d |  j |  j f ƒ |  _ |  j j t ƒ |  j j ƒ  |  j j ƒ  d  S(   Ni<   t   targett   args(   R   t   EventR   R   t   AF_INETt   SOCK_STREAMt   sockt
   settimeoutR   t	   bind_portt   portt   ThreadR   t   threadt	   setDaemonR   t   startt   wait(   t   self(    (    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_telnetlib.pyt   setUp-   s    'c         C   s   |  j  j ƒ  d  S(   N(   R)   t   join(   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_telnetlib.pyt   tearDown7   s    c         C   s&   t  j t |  j ƒ } | j j ƒ  d  S(   N(   t	   telnetlibt   Telnett   HOSTR'   R$   R   (   R-   t   telnet(    (    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_telnetlib.pyt	   testBasic:   s    c         C   sz   |  j  t j ƒ  d  k ƒ t j d ƒ z t j t |  j ƒ } Wd  t j d  ƒ X|  j	 | j
 j ƒ  d ƒ | j
 j ƒ  d  S(   Ni   (   t
   assertTrueR   t   getdefaulttimeoutt   Nonet   setdefaulttimeoutR1   R2   R3   R'   t   assertEqualR$   t
   gettimeoutR   (   R-   R4   (    (    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_telnetlib.pyt   testTimeoutDefault?   s    c         C   sƒ   |  j  t j ƒ  d  k ƒ t j d ƒ z t j t |  j d d  ƒ} Wd  t j d  ƒ X|  j  | j	 j
 ƒ  d  k ƒ | j	 j ƒ  d  S(   Ni   R   (   R6   R   R7   R8   R9   R1   R2   R3   R'   R$   R;   R   (   R-   R4   (    (    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_telnetlib.pyt   testTimeoutNoneI   s    c         C   sE   t  j t |  j d d ƒ} |  j | j j ƒ  d ƒ | j j ƒ  d  S(   NR   i   (   R1   R2   R3   R'   R:   R$   R;   R   (   R-   R4   (    (    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_telnetlib.pyt   testTimeoutValueT   s    c         C   sO   t  j ƒ  } | j t |  j d d ƒ|  j | j j ƒ  d ƒ | j j ƒ  d  S(   NR   i   (	   R1   R2   t   openR3   R'   R:   R$   R;   R   (   R-   R4   (    (    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_telnetlib.pyt   testTimeoutOpenY   s    c         C   sg   t  j t |  j d d ƒ} | j } |  j | j ƒ  | ƒ |  j | j ƒ  | j ƒ  ƒ | j j ƒ  d  S(   NR   i   (	   R1   R2   R3   R'   R$   R:   t
   get_sockett   filenoR   (   R-   R4   t   t_sock(    (    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_telnetlib.pyt   testGetters_   s
    	(
   t   __name__t
   __module__R.   R0   R5   R<   R=   R>   R@   RD   (    (    (    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_telnetlib.pyR   +   s   	
			
			c         C   s©   t  j ƒ  |  _ t j ƒ  |  _ t j t j t j ƒ |  _ |  j j	 d ƒ t
 j |  j ƒ |  _ t  j d t d |  j |  j |  j f ƒ |  _ |  j j ƒ  |  j j ƒ  d  S(   Ni
   R   R    (   R   R!   R   t   QueueR   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_telnetlib.pyt   _read_setUpg   s    -c         C   s   |  j  j ƒ  d  S(   N(   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_telnetlib.pyt   _read_tearDownq   s    t	   ReadTestsc           B   sæ   e  Z 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 RS(   g333333ã?g333333Ó?c         C   st   d d d	 t  g } |  j j | ƒ t j t |  j ƒ } |  j j ƒ  | j d ƒ } |  j	 | d j | d  ƒ ƒ d S(
   s«   
        read_until(expected, [timeout])
          Read until the expected string has been seen, or a timeout is
          hit (default is no timeout); may block.
        t   xi
   t   matcht   yR   iþÿÿÿNt
   xxxxxxxxxxt
   yyyyyyyyyy(
   R
   R   t   putR1   R2   R3   R'   R/   t
   read_untilR:   (   R-   t   wantR4   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_telnetlib.pyt   test_read_until_A|   s    c         C   sŠ   d |  j  d t g } |  j j | ƒ t j t |  j ƒ } |  j j ƒ  | j	 d |  j
 ƒ } |  j | | d ƒ |  j | j ƒ  d ƒ d  S(   Nt   hellos   not seeni    (   t
   block_longR
   R   RP   R1   R2   R3   R'   R/   RQ   t   block_shortR:   t   read_all(   R-   RR   R4   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_telnetlib.pyt   test_read_until_B‰   s    c         C   s˜   d	 d d
 t  g } |  j j | ƒ t j t |  j ƒ } | j sR t j	 d ƒ ‚ n  t
 | _ |  j j ƒ  | j d ƒ } |  j | d j | d  ƒ ƒ d S(   s3   Use select.poll() to implement telnet.read_until().RK   i
   RL   RM   s   select.poll() is requiredR   iþÿÿÿNRN   RO   (   R
   R   RP   R1   R2   R3   R'   t	   _has_pollt   unittestt   SkipTestR   R/   RQ   R:   (   R-   RR   R4   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_telnetlib.pyt   test_read_until_with_poll“   s    		c         C   s}   d d d	 t  g } |  j j | ƒ t j t |  j ƒ } t | _ |  j j	 ƒ  | j
 d ƒ } |  j | d j	 | d  ƒ ƒ d S(
   s5   Use select.select() to implement telnet.read_until().RK   i
   RL   RM   R   iþÿÿÿNRN   RO   (   R
   R   RP   R1   R2   R3   R'   t   FalseRY   R/   RQ   R:   (   R-   RR   R4   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_telnetlib.pyt   test_read_until_with_selectŸ   s    	c         C   s}   d d d d d d t  g } |  j j | ƒ t j t |  j ƒ } |  j j ƒ  | j ƒ  } |  j	 | d j | d  ƒ ƒ d S(   sJ   
        read_all()
          Read all data until EOF; may block.
        RK   iô  RM   t   zR   iÿÿÿÿN(
   R
   R   RP   R1   R2   R3   R'   R/   RW   R:   (   R-   RR   R4   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_telnetlib.pyt   test_read_all_A©   s    c         C   s_   |  j  j |  j t g ƒ |  j  j ƒ  t j ƒ  } | ƒ  } |  j |  j t j ƒ  | k ƒ d  S(   N(   R   RP   RU   R
   R/   R   R6   RV   (   R-   t   funcR+   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_telnetlib.pyt   _test_blockingµ   s
    	c         C   s#   |  j  t j t |  j ƒ j ƒ d  S(   N(   Rb   R1   R2   R3   R'   RW   (   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_telnetlib.pyt   test_read_all_B¼   s    c         C   sM   |  j  j t g ƒ t j t |  j ƒ } |  j  j ƒ  | j ƒ  | j ƒ  d  S(   N(	   R   RP   R
   R1   R2   R3   R'   R/   RW   (   R-   R4   (    (    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_telnetlib.pyt   test_read_all_C¿   s
    
c         C   sk   d d t  g } |  j j | ƒ t j t |  j ƒ } |  j j ƒ  | j ƒ  } |  j	 t
 | ƒ d k ƒ d S(   sQ   
        read_some()
          Read at least one byte or EOF; may block.
        RK   iô  i   N(   R
   R   RP   R1   R2   R3   R'   R/   RW   R6   t   len(   R-   RR   R4   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_telnetlib.pyt   test_read_some_AÆ   s    c         C   sO   |  j  j t g ƒ t j t |  j ƒ } |  j  j ƒ  |  j d | j	 ƒ  ƒ d  S(   NR   (
   R   RP   R
   R1   R2   R3   R'   R/   R:   t	   read_some(   R-   R4   (    (    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_telnetlib.pyt   test_read_some_BÓ   s    c         C   s#   |  j  t j t |  j ƒ j ƒ d  S(   N(   Rb   R1   R2   R3   R'   Rg   (   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_telnetlib.pyt   test_read_some_CÚ   s    c         C   sÓ   |  j  d d d d t g } | d | d } |  j j | ƒ t j t |  j ƒ } |  j j ƒ  t	 | | ƒ } d } xF t
 r¾ y' | | ƒ  7} |  j | j | ƒ ƒ Wqy t k
 rº Pqy Xqy W|  j | | ƒ d S(   s‚   
        read_very_eager()
          Read all data available already queued or on the socket,
          without blocking.
        RK   id   RM   i   i   R   N(   RU   R
   R   RP   R1   R2   R3   R'   R/   t   getattrR   R6   t
   startswitht   EOFErrorR:   (   R-   t	   func_nameRR   t   expectsR4   Ra   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_telnetlib.pyt   _test_read_any_eager_AÝ   s    		c         C   sh   |  j  j t g ƒ t j t |  j ƒ } |  j  j ƒ  t j	 |  j
 ƒ t | | ƒ } |  j t | ƒ d  S(   N(   R   RP   R
   R1   R2   R3   R'   R/   R   R   RV   Rj   t   assertRaisesRl   (   R-   Rm   R4   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_telnetlib.pyt   _test_read_any_eager_Bò   s    c         C   s   |  j  d ƒ d  S(   Nt   read_very_eager(   Ro   (   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_telnetlib.pyt   test_read_very_eager_Aý   s    c         C   s   |  j  d ƒ d  S(   NRr   (   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_telnetlib.pyt   test_read_very_eager_Bÿ   s    c         C   s   |  j  d ƒ d  S(   Nt
   read_eager(   Ro   (   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_telnetlib.pyt   test_read_eager_A  s    c         C   s   |  j  d ƒ d  S(   NRu   (   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_telnetlib.pyt   test_read_eager_B  s    c         C   sb   |  j  j t g ƒ t j t |  j ƒ } |  j  j ƒ  t | | ƒ } | j	 ƒ  |  j
 t | ƒ d  S(   N(   R   RP   R
   R1   R2   R3   R'   R/   Rj   t	   fill_rawqRp   Rl   (   R-   Rm   R4   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_telnetlib.pyt   _test_read_any_lazy_B  s    
c         C   sï   d d t  g } |  j j | ƒ t j t |  j ƒ } |  j j ƒ  t j	 |  j
 ƒ |  j d | j ƒ  ƒ d } xf t rÖ y- | j ƒ  } | | 7} | s£ | j ƒ  n  Wn t k
 r¸ Pn X|  j | d j | ƒ ƒ qq W|  j | | d ƒ d  S(   NRK   id   R   i    (   R
   R   RP   R1   R2   R3   R'   R/   R   R   RV   R:   t	   read_lazyR   Rx   Rl   R6   Rk   (   R-   RR   R4   R   t	   read_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_telnetlib.pyt   test_read_lazy_A  s"    	
c         C   s   |  j  d ƒ d  S(   NRz   (   Ry   (   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_telnetlib.pyt   test_read_lazy_B#  s    c         C   s  d d t  g } |  j j | ƒ t j t |  j ƒ } |  j j ƒ  t j	 |  j
 ƒ |  j d | j ƒ  ƒ d } xƒ t ró y | j ƒ  } Wn t k
 r› Pn X| | 7} | sÖ | j ƒ  |  j d | j ƒ | j ƒ  n  |  j | d j | ƒ ƒ qq W|  j | | d ƒ d  S(   NRK   id   R   i    (   R
   R   RP   R1   R2   R3   R'   R/   R   R   RV   R:   t   read_very_lazyR   Rl   Rx   t   cookedqt   process_rawqR6   Rk   (   R-   RR   R4   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_telnetlib.pyt   test_read_very_lazy_A&  s&    	

c         C   s   |  j  d ƒ d  S(   NR~   (   Ry   (   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_telnetlib.pyt   test_read_very_lazy_B;  s    (   RE   RF   RH   R.   RI   R0   RU   RV   RS   RX   R\   R^   R`   Rb   Rc   Rd   Rf   Rh   Ri   Ro   Rq   Rs   Rt   Rv   Rw   Ry   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_telnetlib.pyRJ   t   s4   		
		
																	t   nego_collectorc           B   s   e  Z d d  „ Z d „  Z RS(   c         C   s   d |  _  | |  _ d |  _ d  S(   NR   (   t   seent	   sb_gettert   sb_seen(   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_telnetlib.pyt   __init__?  s    		c         C   sM   |  j  | | 7_  | t j k rI |  j rI |  j ƒ  } |  j | 7_ n  d  S(   N(   R„   t   tlt   SER…   R†   (   R-   R$   t   cmdt   optt   sb_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_telnetlib.pyt   do_negoD  s    N(   RE   RF   R8   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_telnetlib.pyRƒ   >  s   t   OptionTestsc           B   se   e  Z e Z e Z e j e j e j	 e j
 e j e j e j e j g Z d  „  Z d „  Z d „  Z RS(   c         C   sõ   |  j  ƒ  |  j j | ƒ t j t |  j ƒ } |  j j ƒ  t ƒ  } | j	 | j
 ƒ | j ƒ  } | j } |  j t | ƒ d k ƒ |  j | d |  j ƒ |  j | d t j ƒ |  j t d j | d  ƒ ƒ t | | ƒ ƒ d | _ |  j ƒ  d S(   s    helper for testing IAC + cmd i    i   R   iÿÿÿÿN(   R.   R   RP   R1   R2   R3   R'   R/   Rƒ   t   set_option_negotiation_callbackR�   RW   R„   R6   Re   t   assertInt   cmdsR:   Rˆ   t   NOOPTR8   R…   R0   (   R-   R   R4   t   negot   txtRŠ   (    (    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_telnetlib.pyt   _test_commandQ  s    
		-	c         C   s   |  j  j t g ƒ t j t |  j ƒ } |  j  j ƒ  |  j ƒ  xs |  j	 D]h } |  j
 d d t j | d d t g ƒ |  j
 d t j | d t g ƒ |  j
 t j | t g ƒ qI W|  j
 g  |  j	 D] } t j | ^ qÅ t g ƒ |  j d | j ƒ  ƒ d  S(   NRK   id   RM   i
   R   RN   RO   (   R   RP   R
   R1   R2   R3   R'   R/   R0   R‘   R•   Rˆ   t   IACR:   t   read_sb_data(   R-   R4   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_telnetlib.pyt   test_IAC_commandsb  s    
( 1c         C   s¥  t  j t  j t  j t  j t  j t  j t  j t  j t  j t  j t  j t  j t  j t  j d t  j t  j t  j t  j d t  j t  j t  j t  j t  j t  j d t  j t  j d t  j t  j t g } |  j j | ƒ t j t	 |  j
 ƒ } |  j j ƒ  t | j ƒ } | j | j ƒ | j ƒ  } |  j | d ƒ t  j t  j d t  j d t  j d } |  j | j | ƒ |  j d | j ƒ  ƒ d  | _ d  S(   Nt   aat   bbt   cct   ddR   t   aabb(   Rˆ   R–   t   SBR‰   R
   R   RP   R1   R2   R3   R'   R/   Rƒ   R—   R�   R�   RW   R:   R†   R8   R…   (   R-   R   R4   R“   R”   t   want_sb_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_telnetlib.pyt   test_SB_commandsq  s"    )--1	*(   RE   RF   RH   R.   RI   R0   Rˆ   t   AOt   AYTt   BRKt   ECt   ELt   GAt   IPt   NOPR‘   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_telnetlib.pyRŽ   K  s   6		t   ExpectTestsc           B   sJ   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 ƒ |  _ t  j d t d |  j |  j |  j f ƒ |  _ |  j j ƒ  |  j j ƒ  d  S(   Ni
   R   R    (   R   R!   R   RG   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_telnetlib.pyR.   ˆ  s    c         C   s   |  j  j ƒ  d  S(   N(   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_telnetlib.pyR0   “  s    g333333ã?g333333Ó?c         C   s€   d d d	 t  g } |  j j | ƒ t j t |  j ƒ } |  j j ƒ  | j d g ƒ \ } } } |  j	 | d j | d  ƒ ƒ d S(
   s§   
        expect(expected, [timeout])
          Read until the expected string has been seen, or a timeout is
          hit (default is no timeout); may block.
        RK   i
   RL   RM   R   iþÿÿÿNRN   RO   (
   R
   R   RP   R1   R2   R3   R'   R/   t   expectR:   (   R-   RR   R4   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_telnetlib.pyt   test_expect_Aš  s    c         C   s–   d |  j  d t g } |  j j | ƒ t j t |  j ƒ } |  j j ƒ  | j	 d g |  j
 ƒ \ } } } |  j | | d ƒ |  j | j ƒ  d ƒ d  S(   NRT   s   not seeni    (   RU   R
   R   RP   R1   R2   R3   R'   R/   Rª   RV   R:   RW   (   R-   RR   R4   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_telnetlib.pyt   test_expect_B§  s    !c         C   s¤   d	 d d
 t  g } |  j j | ƒ t j t |  j ƒ } | j sR t j	 d ƒ ‚ n  t
 | _ |  j j ƒ  | j d g ƒ \ } } } |  j | d j | d  ƒ ƒ d S(   s/   Use select.poll() to implement telnet.expect().RK   i
   RL   RM   s   select.poll() is requiredR   iþÿÿÿNRN   RO   (   R
   R   RP   R1   R2   R3   R'   RY   RZ   R[   R   R/   Rª   R:   (   R-   RR   R4   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_telnetlib.pyt   test_expect_with_poll±  s    		c         C   s‰   d d d	 t  g } |  j j | ƒ t j t |  j ƒ } t | _ |  j j	 ƒ  | j
 d g ƒ \ } } } |  j | d j	 | d  ƒ ƒ d S(
   s1   Use select.select() to implement telnet.expect().RK   i
   RL   RM   R   iþÿÿÿNRN   RO   (   R
   R   RP   R1   R2   R3   R'   R]   RY   R/   Rª   R:   (   R-   RR   R4   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_telnetlib.pyt   test_expect_with_select½  s    	(
   RE   RF   R.   R0   RU   RV   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_telnetlib.pyR©   ‡  s   				
	c         C   s   t  j t t t t ƒ d  S(   N(   R   t   run_unittestR   RJ   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_telnetlib.pyt	   test_mainÈ  s    t   __main__(   R   R1   R   RG   RZ   R    t   testR   t   import_moduleR   R3   t   objectR
   R8   R   R   RH   RI   RJ   Rƒ   Rˆ   RŽ   R©   R²   RE   (    (    (    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_telnetlib.pyt   <module>   s*   		<	
	Ê<A