ó
[³XMc           @   sX  d  d l  m Z m Z d  d l m Z m Z m Z d e f d „  ƒ  YZ d e j	 f d „  ƒ  YZ
 d e j	 f d „  ƒ  YZ d	 e j	 f d
 „  ƒ  YZ d e j	 f d „  ƒ  YZ d e j	 f d „  ƒ  YZ d e j	 f d „  ƒ  YZ d e _ d e j	 f d „  ƒ  YZ d e j	 f d „  ƒ  YZ d e j	 f d „  ƒ  YZ d e j	 f d „  ƒ  YZ d „  Z d S(   iÿÿÿÿ(   t   unittestt   util(   t   reactort   protocolt   defert   FoolishErrorc           B   s   e  Z RS(    (   t   __name__t
   __module__(    (    (    s@   /usr/lib/python2.7/dist-packages/twisted/trial/test/erroneous.pyR   	   s   t   TestFailureInSetUpc           B   s   e  Z d  „  Z d „  Z RS(   c         C   s   t  d ‚ d  S(   Ns   I am a broken setUp method(   R   (   t   self(    (    s@   /usr/lib/python2.7/dist-packages/twisted/trial/test/erroneous.pyt   setUp   s    c         C   s   d  S(   N(    (   R	   (    (    s@   /usr/lib/python2.7/dist-packages/twisted/trial/test/erroneous.pyt	   test_noop   s    (   R   R   R
   R   (    (    (    s@   /usr/lib/python2.7/dist-packages/twisted/trial/test/erroneous.pyR      s   	t   TestFailureInTearDownc           B   s   e  Z d  „  Z d „  Z RS(   c         C   s   t  d ‚ d  S(   Ns   I am a broken tearDown method(   R   (   R	   (    (    s@   /usr/lib/python2.7/dist-packages/twisted/trial/test/erroneous.pyt   tearDown   s    c         C   s   d  S(   N(    (   R	   (    (    s@   /usr/lib/python2.7/dist-packages/twisted/trial/test/erroneous.pyR      s    (   R   R   R   R   (    (    (    s@   /usr/lib/python2.7/dist-packages/twisted/trial/test/erroneous.pyR      s   	t   TestRegularFailc           B   s#   e  Z d  „  Z d „  Z d „  Z RS(   c         C   s   |  j  d ƒ d  S(   Ns   I fail(   t   fail(   R	   (    (    s@   /usr/lib/python2.7/dist-packages/twisted/trial/test/erroneous.pyt	   test_fail   s    c         C   s   |  j  ƒ  d  S(   N(   t
   subroutine(   R	   (    (    s@   /usr/lib/python2.7/dist-packages/twisted/trial/test/erroneous.pyt   test_subfail!   s    c         C   s   |  j  d ƒ d  S(   Ns   I fail inside(   R   (   R	   (    (    s@   /usr/lib/python2.7/dist-packages/twisted/trial/test/erroneous.pyR   $   s    (   R   R   R   R   R   (    (    (    s@   /usr/lib/python2.7/dist-packages/twisted/trial/test/erroneous.pyR      s   		t   TestFailureInDeferredChainc           B   s   e  Z d  „  Z d „  Z RS(   c         C   s6   t  j ƒ  } | j |  j ƒ t j d | j d  ƒ | S(   Ni    (   R   t   Deferredt   addCallbackt   _laterR   t	   callLatert   callbackt   None(   R	   t   d(    (    s@   /usr/lib/python2.7/dist-packages/twisted/trial/test/erroneous.pyR   (   s    c         C   s   |  j  d ƒ d  S(   Ns   I fail later(   R   (   R	   t   res(    (    s@   /usr/lib/python2.7/dist-packages/twisted/trial/test/erroneous.pyR   -   s    (   R   R   R   R   (    (    (    s@   /usr/lib/python2.7/dist-packages/twisted/trial/test/erroneous.pyR   '   s   	t	   ErrorTestc           B   s   e  Z d  Z e Z d „  Z RS(   s   
    A test case which has a L{test_foo} which will raise an error.

    @ivar ran: boolean indicating whether L{test_foo} has been run.
    c         C   s   t  |  _ d d d S(   sJ   
        Set C{self.ran} to True and raise a C{ZeroDivisionError}
        i   i    N(   t   Truet   ran(   R	   (    (    s@   /usr/lib/python2.7/dist-packages/twisted/trial/test/erroneous.pyt   test_foo:   s    	(   R   R   t   __doc__t   FalseR   R   (    (    (    s@   /usr/lib/python2.7/dist-packages/twisted/trial/test/erroneous.pyR   2   s   t   TestSkipTestCasec           B   s   e  Z RS(    (   R   R   (    (    (    s@   /usr/lib/python2.7/dist-packages/twisted/trial/test/erroneous.pyR"   C   s   s   skipping this testt   DelayedCallc           B   s>   e  Z d  Z d „  Z d „  Z e j d d d e ƒ g e _ RS(   s   something blew upc         C   s   t  |  j ƒ ‚ d  S(   N(   t   RuntimeErrort   hiddenExceptionMsg(   R	   (    (    s@   /usr/lib/python2.7/dist-packages/twisted/trial/test/erroneous.pyt   goL   s    c         C   s1   t  j d |  j ƒ t  j d ƒ |  j d ƒ d S(   s­  
        What happens if an error is raised in a DelayedCall and an error is
        also raised in the test?

        L{test_reporter.TestErrorReporting.testHiddenException} checks that
        both errors get reported.

        Note that this behaviour is deprecated. A B{real} test would return a
        Deferred that got triggered by the callLater. This would guarantee the
        delayed call error gets reported.
        i    g{®Gáz„?s/   Deliberate failure to mask the hidden exceptionN(   R   R   R&   t   iterateR   (   R	   (    (    s@   /usr/lib/python2.7/dist-packages/twisted/trial/test/erroneous.pyt   testHiddenExceptionO   s    t   messages!   reactor\.iterate cannot be used.*t   category(   R   R   R%   R&   R(   R   t   suppresst   DeprecationWarning(    (    (    s@   /usr/lib/python2.7/dist-packages/twisted/trial/test/erroneous.pyR#   I   s   			t   ReactorCleanupTestsc           B   s   e  Z d  „  Z RS(   c         C   s   d „  } t  j d | ƒ d  S(   Nc           S   s	   d GHd  S(   Ns   foo!(    (    (    (    s@   /usr/lib/python2.7/dist-packages/twisted/trial/test/erroneous.pyt   _e   s    g     ˆÃ@(   R   R   (   R	   R.   (    (    s@   /usr/lib/python2.7/dist-packages/twisted/trial/test/erroneous.pyt   test_leftoverPendingCallsd   s    	(   R   R   R/   (    (    (    s@   /usr/lib/python2.7/dist-packages/twisted/trial/test/erroneous.pyR-   c   s   t   SocketOpenTestc           B   s   e  Z d  „  Z RS(   c         C   s,   t  j ƒ  } t  j | _  t j d | ƒ d  S(   Ni    (   R   t   Factoryt   ProtocolR   t	   listenTCP(   R	   t   f(    (    s@   /usr/lib/python2.7/dist-packages/twisted/trial/test/erroneous.pyt   test_socketsLeftOpenj   s    (   R   R   R5   (    (    (    s@   /usr/lib/python2.7/dist-packages/twisted/trial/test/erroneous.pyR0   i   s   t   TimingOutDeferredc           B   s#   e  Z d  „  Z d „  Z d „  Z RS(   c         C   s   d  S(   N(    (   R	   (    (    s@   /usr/lib/python2.7/dist-packages/twisted/trial/test/erroneous.pyt
   test_alphap   s    c         C   s   t  |  _ t j ƒ  } | S(   N(   R   t   methodCalledR   R   (   R	   R   (    (    s@   /usr/lib/python2.7/dist-packages/twisted/trial/test/erroneous.pyt   test_deferredThatNeverFiress   s    	c         C   s   d  S(   N(    (   R	   (    (    s@   /usr/lib/python2.7/dist-packages/twisted/trial/test/erroneous.pyt
   test_omegax   s    (   R   R   R7   R9   R:   (    (    (    s@   /usr/lib/python2.7/dist-packages/twisted/trial/test/erroneous.pyR6   o   s   		c         C   s   d S(   sc   i will raise an unexpected exception...
    ... *CAUSE THAT'S THE KINDA GUY I AM*

    >>> 1/0
    N(    (   R	   (    (    s@   /usr/lib/python2.7/dist-packages/twisted/trial/test/erroneous.pyt   unexpectedException|   s    N(   t   twisted.trialR    R   t   twisted.internetR   R   R   t	   ExceptionR   t   TestCaseR   R   R   R   R   R"   t   skipR#   R-   R0   R6   R;   (    (    (    s@   /usr/lib/python2.7/dist-packages/twisted/trial/test/erroneous.pyt   <module>   s   
	