ó
úR‹_c           @   sÄ   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 d Z e j	 d d „  ƒ d d „ Z
 d	 e e j f d
 „  ƒ  YZ d e f d „  ƒ  YZ e d k rÀ e j ƒ  n  d S(   iÿÿÿÿN(   t   Event(   t   TimeAssertMixingš™™™™™©?i   c           C   s   d  S(   N(   t   None(    (    (    s\   /var/www/syncserver/local/lib/python2.7/site-packages/gevent/tests/test__hub_join_timeout.pyt   <lambda>   t    i   c            s%   t  j ˆ  ƒ ‡  ‡ f d †  ƒ } | S(   Nc            s%   x t  ˆ ƒ D] } ˆ  |  ƒ q Wd  S(   N(   t   range(   t   selft   _(   t   funct   repetitions(    s\   /var/www/syncserver/local/lib/python2.7/site-packages/gevent/tests/test__hub_join_timeout.pyt   f   s    (   t	   functoolst   wraps(   R   R	   R
   (    (   R   R	   s\   /var/www/syncserver/local/lib/python2.7/site-packages/gevent/tests/test__hub_join_timeout.pyt   repeated   s    !t   Testc           B   sb   e  Z e d  „  ƒ Z e d „  ƒ Z e d „  ƒ Z e d „  ƒ Z e d „  ƒ Z e d „  ƒ Z RS(   c         C   sn   t  j d „  ƒ } |  j ƒ   t  j d d ƒ } Wd  QX|  j | ƒ |  j | j | ƒ |  j | j d ƒ d  S(   Nc           S   s   d S(   Ni   (    (    (    (    s\   /var/www/syncserver/local/lib/python2.7/site-packages/gevent/tests/test__hub_join_timeout.pyR      R   t   timeouti
   i   (   t   geventt   spawnt   runs_in_no_timet   waitt
   assertTruet   deadt   assertEqualt   value(   R   t   xt   result(    (    s\   /var/www/syncserver/local/lib/python2.7/site-packages/gevent/tests/test__hub_join_timeout.pyt   test_callback   s    c         C   sa   t  j t d „  ƒ } |  j t ƒ  t  j d d ƒ } Wd  QX|  j | ƒ |  j | j | ƒ d  S(   Nc           S   s   d S(   Ni   (    (    (    (    s\   /var/www/syncserver/local/lib/python2.7/site-packages/gevent/tests/test__hub_join_timeout.pyR   &   R   R   i
   (   R   t   spawn_latert
   SMALL_TICKt   runs_in_given_timeR   R   R   (   R   R   R   (    (    s\   /var/www/syncserver/local/lib/python2.7/site-packages/gevent/tests/test__hub_join_timeout.pyt
   test_later#   s
    c         C   s—   t  j d d „  ƒ } |  j t ƒ  t  j d t ƒ } Wd  QX|  j | ƒ |  j | j | ƒ | j ƒ  |  j ƒ   t  j ƒ  } Wd  QX|  j	 | ƒ d  S(   Ni
   c           S   s   d S(   Ni   (    (    (    (    s\   /var/www/syncserver/local/lib/python2.7/site-packages/gevent/tests/test__hub_join_timeout.pyR   /   R   R   (
   R   R   R   R   R   t   assertFalseR   t   killR   R   (   R   R   R   (    (    s\   /var/www/syncserver/local/lib/python2.7/site-packages/gevent/tests/test__hub_join_timeout.pyt   test_timeout,   s    
c         C   sÛ   t  j d d „  ƒ } t ƒ  } t  j t | j ƒ } |  j t ƒ  t  j | g ƒ } Wd  QX|  j | | g ƒ |  j | j	 | ƒ |  j
 | j	 ƒ |  j
 | j ƒ | j ƒ  |  j ƒ   t  j ƒ  } Wd  QX|  j
 | ƒ d  S(   Ni
   c           S   s   d S(   Ni   (    (    (    (    s\   /var/www/syncserver/local/lib/python2.7/site-packages/gevent/tests/test__hub_join_timeout.pyR   =   R   (   R   R   R    R   t   setR   R   R   R   R   R   t   is_setR    R   (   R   R   t   eventt	   event_setR   (    (    s\   /var/www/syncserver/local/lib/python2.7/site-packages/gevent/tests/test__hub_join_timeout.pyt
   test_event:   s    	
c         C   sX   t  j ƒ  j j d d t ƒj d „  ƒ |  j ƒ   t  j ƒ  } Wd  QX|  j | ƒ d  S(   Ni
   t   refc           S   s   d  S(   N(   R   (    (    (    s\   /var/www/syncserver/local/lib/python2.7/site-packages/gevent/tests/test__hub_join_timeout.pyR   O   R   (	   R   t   get_hubt   loopt   timert   Falset   startR   R   R   (   R   R   (    (    s\   /var/www/syncserver/local/lib/python2.7/site-packages/gevent/tests/test__hub_join_timeout.pyt   test_ref_argL   s    (c         C   sa   t  j ƒ  j j d ƒ } | j d „  ƒ t | _ |  j ƒ   t  j ƒ  } Wd  QX|  j	 | ƒ d  S(   Ni
   c           S   s   d  S(   N(   R   (    (    (    s\   /var/www/syncserver/local/lib/python2.7/site-packages/gevent/tests/test__hub_join_timeout.pyR   X   R   (
   R   R(   R)   R*   R,   R+   R'   R   R   R   (   R   t   wR   (    (    s\   /var/www/syncserver/local/lib/python2.7/site-packages/gevent/tests/test__hub_join_timeout.pyt   test_ref_attributeT   s    	(	   t   __name__t
   __module__R   R   R   R!   R&   R-   R/   (    (    (    s\   /var/www/syncserver/local/lib/python2.7/site-packages/gevent/tests/test__hub_join_timeout.pyR      s   
	t	   TestAgainc           B   s   e  Z d  Z RS(   s   Repeat the same tests(   R0   R1   t   __doc__(    (    (    s\   /var/www/syncserver/local/lib/python2.7/site-packages/gevent/tests/test__hub_join_timeout.pyR2   _   s   t   __main__(   R   t   unittestR   t   gevent.coret   gevent.eventR    t   gevent.testing.testcaseR   R   t   signalR   t   TestCaseR   R2   R0   t   main(    (    (    s\   /var/www/syncserver/local/lib/python2.7/site-packages/gevent/tests/test__hub_join_timeout.pyt   <module>   s   H