ó
‹wÛjc           @   s  d  d l  Z  d  d l Z d  d l Z d  d l Z y d  d l Z Wn e k
 rY d Z n Xd  d l m Z d  d l m	 Z	 e	 j
 Z
 e d „ Z d e f d „  ƒ  YZ e j e d ƒ d e f d	 „  ƒ  Yƒ Z e j e d ƒ d
 e f d „  ƒ  Yƒ Z d d „ Z e d k re ƒ  n  d S(   iÿÿÿÿN(   t   TestCase(   t   test_supportc         C   s�   | j  d ƒ zf y | j ƒ  \ } } Wn t j k
 r< n6 X| r[ | j d d d ƒ n | j d ƒ | j ƒ  Wd  | j ƒ  |  j ƒ  Xd  S(   Ni   s   1 I'm too long responsei¸  s   
s   1 I'm OK response
(   t   listent   acceptt   sockett   timeoutt   sendt   closet   set(   t   evtt   servt   evilt   connt   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_nntplib.pyt   server   s     
t   BaseServerTestc           B   s   e  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 |  j f ƒ j ƒ  t j d ƒ d  S(   Ni   t   targett   argsgš™™™™™¹?(   t	   threadingt   EventR	   R   t   AF_INETt   SOCK_STREAMt   sockt
   settimeoutR   t	   bind_portt   portt   ThreadR   R   t   startt   timet   sleep(   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_nntplib.pyt   setUp$   s    	c         C   s   |  j  j ƒ  d  S(   N(   R	   t   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_nntplib.pyt   tearDown.   s    (   t   __name__t
   __module__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_nntplib.pyR   #   s   	
s   threading requiredt   ServerTestsc           B   s   e  Z e Z d  „  Z RS(   c         C   s&   t  j d |  j ƒ } | j j ƒ  d  S(   Nt	   localhost(   t   nntplibt   NNTPR   R   R   (   R   t   nntp(    (    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_nntplib.pyt   test_basic_connect6   s    (   R"   R#   t   FalseR   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_nntplib.pyR$   2   s   t   EvilServerTestsc           B   s   e  Z e Z d  „  Z RS(   c         C   s#   |  j  t j t j d |  j ƒ d  S(   NR%   (   t   assertRaisesR&   t   NNTPDataErrorR'   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_nntplib.pyt   test_too_long_line?   s    (   R"   R#   t   TrueR   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_nntplib.pyR+   ;   s   c         C   s   t  j t ƒ t  j t ƒ d  S(   N(   R   t   run_unittestR+   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_nntplib.pyt	   test_mainD   s    t   __main__(   R   R&   R   t   unittestR   t   ImportErrort   NoneR    t   testR   t   HOSTR*   R   R   t
   skipUnlessR$   R+   R2   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_nntplib.pyt   <module>   s&   
	