o
    bM                     @   s  d Z ddlmZmZmZmZ G dd dZG dd deeZG dd deeZG d	d
 d
Z	G dd de	eZ
G dd de	eZG dd dZG dd deeZG dd deeZG dd dZG dd deeZG dd deeZG dd dZG dd deeZG dd  d eeZG d!d" d"ZG d#d$ d$eeZG d%d& d&eeZG d'd( d(ZG d)d* d*eeZG d+d, d,eeZG d-d. d.ZG d/d0 d0eeZG d1d2 d2eeZG d3d4 d4ZG d5d6 d6eeZG d7d8 d8eeZ G d9d: d:Z!G d;d< d<e!eZ"G d=d> d>e!eZ#d?S )@a$  
Definitions of test cases with various interesting behaviors, to be used by
L{twisted.trial.test.test_tests} and other test modules to exercise different
features of trial's test runner.

See the L{twisted.trial.test.test_tests} module docstring for details about how
this code is arranged.
    )FailTestSkipTestSynchronousTestCaseTestCasec                   @   s0   e Zd Zdd Zdd Zde_dd Zde_d	S )
SkippingMixinc                 C      t dNskip1r   self r   =/usr/lib/python3/dist-packages/twisted/trial/test/skipping.py
test_skip1      zSkippingMixin.test_skip1c                 C   r   )NzI should not get raisedRuntimeErrorr   r   r   r   
test_skip2   r   zSkippingMixin.test_skip2skip2c                 C      |  d d S )NzI should not failfailr   r   r   r   
test_skip3      zSkippingMixin.test_skip3skip3N)__name__
__module____qualname__r   r   skipr   r   r   r   r   r      s    
r   c                   @      e Zd ZdS )SynchronousSkippingNr   r   r   r   r   r   r   r    !       r    c                   @   r   )AsynchronousSkippingNr!   r   r   r   r   r#   %   r"   r#   c                   @   s$   e Zd Zdd Zdd Zdd ZdS )SkippingSetUpMixinc                 C   r   )N	skipSetUpr
   r   r   r   r   setUp*   r   zSkippingSetUpMixin.setUpc                 C      d S Nr   r   r   r   r   test_1-      zSkippingSetUpMixin.test_1c                 C   r'   r(   r   r   r   r   r   test_20   r*   zSkippingSetUpMixin.test_2N)r   r   r   r&   r)   r+   r   r   r   r   r$   )   s    r$   c                   @   r   )SynchronousSkippingSetUpNr!   r   r   r   r   r,   4   r"   r,   c                   @   r   )AsynchronousSkippingSetUpNr!   r   r   r   r   r-   8   r"   r-   c                   @   s   e Zd Zdd ZdS )DeprecatedReasonlessSkipMixinc                 C   s   t  r(   r
   r   r   r   r   r)   =   s   z$DeprecatedReasonlessSkipMixin.test_1N)r   r   r   r)   r   r   r   r   r.   <   s    r.   c                   @   r   )#SynchronousDeprecatedReasonlessSkipNr!   r   r   r   r   r/   A   s    r/   c                   @   r   )$AsynchronousDeprecatedReasonlessSkipNr!   r   r   r   r   r0   G   r"   r0   c                   @   s>   e Zd ZdZdd Zdd Zdd Zde_d	d
 Zdd ZdS )SkippedClassMixinclassc                 C   s   d| j _d S )NT)	__class__	_setUpRanr   r   r   r   r&   N      zSkippedClassMixin.setUpc                 C   r   r   r
   r   r   r   r   r   Q   r   zSkippedClassMixin.test_skip1c                 C   r   )NzOught to skip mer   r   r   r   r   r   T   r   zSkippedClassMixin.test_skip2r   c                 C   r'   r(   r   r   r   r   r   r   Y   r*   zSkippedClassMixin.test_skip3c                 C   r   )NzSkip me toor   r   r   r   r   
test_skip4\   r   zSkippedClassMixin.test_skip4N)	r   r   r   r   r&   r   r   r   r6   r   r   r   r   r1   K   s    r1   c                   @   r   )SynchronousSkippedClassNr!   r   r   r   r   r7   `   r"   r7   c                   @   r   )AsynchronousSkippedClassNr!   r   r   r   r   r8   d   r"   r8   c                   @   s6   e Zd Zdd Zde_dd Zde_dd Zd	e_d
S )	TodoMixinc                 C   r   Nzdeliberate failurer   r   r   r   r   
test_todo1i   r   zTodoMixin.test_todo1todo1c                 C   r   Nzdeliberate errorr   r   r   r   r   
test_todo2n   r   zTodoMixin.test_todo2todo2c                 C   s   dS )zunexpected successNr   r   r   r   r   
test_todo3s   s    zTodoMixin.test_todo3todo3N)r   r   r   r;   todor>   r@   r   r   r   r   r9   h   s    
r9   c                   @   r   )SynchronousTodoNr!   r   r   r   r   rC   y   r"   rC   c                   @   r   )AsynchronousTodoNr!   r   r   r   r   rD   }   r"   rD   c                   @   "   e Zd Zdd Zdd Zde_dS )SetUpTodoMixinc                 C   r   r=   r   r   r   r   r   r&      r   zSetUpTodoMixin.setUpc                 C   r'   r(   r   r   r   r   r   r;      r*   zSetUpTodoMixin.test_todo1zsetUp todo1N)r   r   r   r&   r;   rB   r   r   r   r   rF          
rF   c                   @   r   )SynchronousSetUpTodoNr!   r   r   r   r   rH      r"   rH   c                   @   r   )AsynchronousSetUpTodoNr!   r   r   r   r   rI      r"   rI   c                   @   rE   )TearDownTodoMixinc                 C   r   r=   r   r   r   r   r   tearDown   r   zTearDownTodoMixin.tearDownc                 C   r'   r(   r   r   r   r   r   r;      r*   zTearDownTodoMixin.test_todo1ztearDown todo1N)r   r   r   rK   r;   rB   r   r   r   r   rJ      rG   rJ   c                   @   r   )SynchronousTearDownTodoNr!   r   r   r   r   rL      r"   rL   c                   @   r   )AsynchronousTearDownTodoNr!   r   r   r   r   rM      r"   rM   c                   @   s<   e Zd ZdZdd Zde_dd Zdd Zde_d	d
 ZdS )TodoClassMixinr2   c                 C   r'   r(   r   r   r   r   r   r;      r*   zTodoClassMixin.test_todo1methodc                 C   r'   r(   r   r   r   r   r   r>      r*   zTodoClassMixin.test_todo2c                 C   r   NzDeliberate Failurer   r   r   r   r   r@      r   zTodoClassMixin.test_todo3c                 C   r   rP   r   r   r   r   r   
test_todo4   r   zTodoClassMixin.test_todo4N)r   r   r   rB   r;   r>   r@   rQ   r   r   r   r   rN      s    rN   c                   @   r   )SynchronousTodoClassNr!   r   r   r   r   rR      r"   rR   c                   @   r   )AsynchronousTodoClassNr!   r   r   r   r   rS      r"   rS   c                   @   s   e Zd Zdd Zedfe_dd Zeefdfe_dd Zed	fe_d
d Z	ee
fdfe	_dd Zedfe_dd Zedfe_dd Zedfe_dS )StrictTodoMixinc                 C   r   Nzexpected failurer   r   r   r   r   r;      r   zStrictTodoMixin.test_todo1r<   c                 C   r   rU   r   r   r   r   r   r>      r   zStrictTodoMixin.test_todo2r?   c                 C   r   Nzwe had no idea!r   r   r   r   r   r@      r   zStrictTodoMixin.test_todo3rA   c                 C   r   rV   r   r   r   r   r   rQ      r   zStrictTodoMixin.test_todo4todo4c                 C   r   r:   r   r   r   r   r   
test_todo5   r   zStrictTodoMixin.test_todo5todo5c                 C   r   r:   r   r   r   r   r   
test_todo6   r   zStrictTodoMixin.test_todo6todo6c                 C   r'   r(   r   r   r   r   r   
test_todo7   r*   zStrictTodoMixin.test_todo7todo7N)r   r   r   r;   r   rB   r>   OSErrorr@   rQ   SyntaxErrorrX   r   rZ   r\   r   r   r   r   rT      s    



rT   c                   @   r   )SynchronousStrictTodoNr!   r   r   r   r   r`      r"   r`   c                   @   r   )AsynchronousStrictTodoNr!   r   r   r   r   ra      r"   ra   c                   @   s<   e Zd Zdd Zdd Zdd Zdd Zd	d
 Zdd ZdS )AddCleanupMixinc                 C   s   dg| _ d S )Nr&   )logr   r   r   r   r&      r5   zAddCleanupMixin.setUpc                 C      dg| _ td)Nr&   zDeliberate failure)rc   r   r   r   r   r   brokenSetUp      zAddCleanupMixin.brokenSetUpc                 C   rd   )Nr&   zDon't do this)rc   r   r   r   r   r   skippingSetUp   rf   zAddCleanupMixin.skippingSetUpc                 C   s   | j | d S r(   rc   append)r   thingr   r   r   ri         zAddCleanupMixin.appendc                 C      | j d d S )NrK   rh   r   r   r   r   rK      rk   zAddCleanupMixin.tearDownc                 C   rl   )NrunTestrh   r   r   r   r   rm      rk   zAddCleanupMixin.runTestN)	r   r   r   r&   re   rg   ri   rK   rm   r   r   r   r   rb      s    rb   c                   @   r   )SynchronousAddCleanupNr!   r   r   r   r   rn     r"   rn   c                   @   r   )AsynchronousAddCleanupNr!   r   r   r   r   ro     r"   ro   N)$__doc__twisted.trial.unittestr   r   r   r   r   r    r#   r$   r,   r-   r.   r/   r0   r1   r7   r8   r9   rC   rD   rF   rH   rI   rJ   rL   rM   rN   rR   rS   rT   r`   ra   rb   rn   ro   r   r   r   r   <module>   sD   



%