
    Vhe                         d Z ddlZddlmZ ddlmZ  G d dej                        Z G d d      Z G d	 d
ej                        Z	y)z
Sample test cases defined using the standard library L{unittest.TestCase}
class which are used as data by test cases which are actually part of the
trial test suite to verify handling of handling of such cases.
    N)exc_info)Failurec                   N    e Zd Zd Zd Zd Z ej                  d      d        Zy)
PyUnitTestc                      y)z!
        A passing test.
        N selfs    N/home/dcms/DCMS/lib/python3.12/site-packages/twisted/trial/test/pyunitcases.py	test_passzPyUnitTest.test_pass           c                     t        d      )zE
        A test which raises an exception to cause an error.
        zpyunit error)	Exceptionr	   s    r   
test_errorzPyUnitTest.test_error   s     ''r   c                 &    | j                  d       y)zQ
        A test which uses L{unittest.TestCase.fail} to cause a failure.
        zpyunit failureN)failr	   s    r   	test_failzPyUnitTest.test_fail   s     			"#r   zpyunit skipc                      y)zS
        A test which uses the L{unittest.skip} decorator to cause a skip.
        Nr   r	   s    r   	test_skipzPyUnitTest.test_skip"   r   r   N)	__name__
__module____qualname__r   r   r   unittestskipr   r   r   r   r   r      s0    
($ X]]=! "r   r   c                       e Zd ZdZdefdZy)_NonStringIdz
    A class that looks a little like a TestCase, but not enough so to
    actually be used as one.  This helps L{BrokenRunInfrastructure} use some
    interfaces incorrectly to provoke certain failure conditions.
    returnc                     t               S )N)objectr	   s    r   idz_NonStringId.id0   s	    xr   N)r   r   r   __doc__r    r!   r   r   r   r   r   )   s    F r   r   c                   :    e Zd ZdZd Zd Zd Zd Zd Zd Z	d Z
y	)
BrokenRunInfrastructurezu
    A test suite that is broken at the level of integration between
    L{TestCase.run} and the results object.
    c                 :     t        | | j                        |      S )z
        Override the normal C{run} behavior to pass the result object
        along to the test method.  Each test method needs the result object so
        that it can implement its particular kind of brokenness.
        )getattr_testMethodNamer
   results     r   runzBrokenRunInfrastructure.run:   s     3wtT1126::r   c                 6    |j                  t                      y)zA
        Violate the L{TestResult.addSuccess} interface.
        N)
addSuccessr   r(   s     r   test_addSuccessz'BrokenRunInfrastructure.test_addSuccessB   s    
 	,.)r   c                     	 t        d      # t        $ r t               }Y nw xY w|j                  t	               |       y)z?
        Violate the L{TestResult.addError} interface.
        test_addErrorN)r   BaseExceptionr   addErrorr   r
   r)   errs      r   r/   z%BrokenRunInfrastructure.test_addErrorI   s:    	O,, 	*C	 	,    ##c                     	 t        d      # t        $ r t               }Y nw xY w|j                  t	               |       y)zA
        Violate the L{TestResult.addFailure} interface.
        test_addFailureN)r   r0   r   
addFailurer   r2   s      r   r6   z'BrokenRunInfrastructure.test_addFailureT   s=    	-.. 	*C	 	,.#.r4   c                 8    |j                  t               d       y)z>
        Violate the L{TestResult.addSkip} interface.
        test_addSkipN)addSkipr   r(   s     r   r9   z$BrokenRunInfrastructure.test_addSkip_   s     	|~~6r   c                     	 t        d      # t        $ r t               }Y nw xY w|j                  t	               |       y)zI
        Violate the L{TestResult.addExpectedFailure} interface.
        test_addExpectedFailureN)r   r0   r   addExpectedFailurer   r2   s      r   r<   z/BrokenRunInfrastructure.test_addExpectedFailuree   s;    	566 	)C	!!,.#6r4   c                 6    |j                  t                      y)zK
        Violate the L{TestResult.addUnexpectedSuccess} interface.
        N)addUnexpectedSuccessr   r(   s     r   test_addUnexpectedSuccessz1BrokenRunInfrastructure.test_addUnexpectedSuccesso   s     	##LN3r   N)r   r   r   r"   r*   r-   r/   r6   r9   r<   r@   r   r   r   r$   r$   4   s*    
;*	-	/774r   r$   )
r"   r   sysr   twisted.python.failurer   TestCaser   r   r$   r   r   r   <module>rD      sC      *"" 2 ?4h// ?4r   