ó
úR‹_c           @   sg   d  d l  Z  d  d l j Z d e f d „  ƒ  YZ d e j f d „  ƒ  YZ e d k rc e j	 ƒ  n  d S(   iÿÿÿÿNt   MyExceptionc           B   s   e  Z RS(    (   t   __name__t
   __module__(    (    (    sT   /var/www/syncserver/local/lib/python2.7/site-packages/gevent/tests/test__issue330.pyR       s   t
   TestSwitchc           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  t |  ƒ j ƒ  t t g |  _ d  |  _ d  S(   N(   t   superR   t   setUpt   Falset   switched_tot   Nonet   caught(   t   self(    (    sT   /var/www/syncserver/local/lib/python2.7/site-packages/gevent/tests/test__issue330.pyR      s    c         C   s   t  |  j | <d  S(   N(   t   TrueR   (   R
   t   i(    (    sT   /var/www/syncserver/local/lib/python2.7/site-packages/gevent/tests/test__issue330.pyt   should_never_run   s    c         C   sœ   t  j | | f ƒ |  j t t g |  j ƒ |  j | j t  j ƒ |  j | j t  j ƒ |  j | j	 ƒ |  j | j	 ƒ |  j | j
 ƒ |  j | j
 ƒ d  S(   N(   t   geventt   joinallt   assertEqualR   R   t   assertIsInstancet   valuet   GreenletExitt   assertIsNonet   exc_infot	   exception(   R
   t   gt   g2(    (    sT   /var/www/syncserver/local/lib/python2.7/site-packages/gevent/tests/test__issue330.pyt   check   s    c         C   sX   t  j |  j d ƒ } t  j |  j d ƒ } t  j | ƒ t  j | ƒ |  j | | ƒ d  S(   Ni    i   (   R   t   spawnR   t   killR   (   R
   R   R   (    (    sT   /var/www/syncserver/local/lib/python2.7/site-packages/gevent/tests/test__issue330.pyt   test_gevent_kill#   s
    c         C   sR   t  j |  j d ƒ } t  j |  j d ƒ } | j ƒ  | j ƒ  |  j | | ƒ d  S(   Ni    i   (   R   R   R   R   R   (   R
   R   R   (    (    sT   /var/www/syncserver/local/lib/python2.7/site-packages/gevent/tests/test__issue330.pyt   test_greenlet_kill+   s
    

c         C   s^   t  j |  j d ƒ } t  j |  j d ƒ } | j t  j ƒ | j t  j ƒ |  j | | ƒ d  S(   Ni    i   (   R   R   R   t   throwR   R   (   R
   R   R   (    (    sT   /var/www/syncserver/local/lib/python2.7/site-packages/gevent/tests/test__issue330.pyt
   test_throw3   s
    c         C   sA   y x t  r t j d ƒ q WWn t k
 r< } | |  _ n Xd  S(   Ni    (   R   R   t   sleepR    R	   (   R
   t   e(    (    sT   /var/www/syncserver/local/lib/python2.7/site-packages/gevent/tests/test__issue330.pyt   catcher<   s
    	c         C   sm   t  j |  j ƒ } | j ƒ  t  j ƒ  t  j | t ƒ  ƒ t  j ƒ  |  j |  j t ƒ |  j	 | j
 t ƒ d  S(   N(   R   R   R"   t   startR    R   R    R   R	   R   R   (   R
   R   (    (    sT   /var/www/syncserver/local/lib/python2.7/site-packages/gevent/tests/test__issue330.pyt   test_kill_exceptionC   s    


(
   R   R   R   R   R   R   R   R   R"   R$   (    (    (    sT   /var/www/syncserver/local/lib/python2.7/site-packages/gevent/tests/test__issue330.pyR   
   s   								t   __main__(
   R   t   gevent.testingt   testingt	   greentestt	   ExceptionR    t   TestCaseR   R   t   main(    (    (    sT   /var/www/syncserver/local/lib/python2.7/site-packages/gevent/tests/test__issue330.pyt   <module>   s
   F