U
    T‚gÃ
  ã                   @   s„   d Z ddlmZ ddlmZ eddƒG dd„ deƒƒZeddƒG d	d
„ d
eƒƒZG dd„ deƒZG dd„ deƒZG dd„ deƒZ	dS )z!
Tests for L{twisted.trial.util}
é    )ÚskipIf)ÚTestCaseTz.Skip all tests when @skipIf is used on a classc                   @   s,   e Zd ZdZddœdd„Zddœdd„ZdS )ÚSkipDecoratorUsedOnClasszZ
    All tests should be skipped because @skipIf decorator is used on
    this class.
    N©Úreturnc                 C   s   t dƒ‚d S ©Nz%Test should skip and never reach here©Ú	Exception©Úself© r   ú@/tmp/pip-unpacked-wheel-1_7di8ic/twisted/trial/test/test_skip.pyÚtest_shouldNeverRun_1   s    z.SkipDecoratorUsedOnClass.test_shouldNeverRun_1c                 C   s   t dƒ‚d S r   r   r
   r   r   r   Útest_shouldNeverRun_2   s    z.SkipDecoratorUsedOnClass.test_shouldNeverRun_2©Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r   r   r      s   r   Ú c                   @   s,   e Zd ZdZddœdd„Zddœdd„ZdS )Ú'SkipDecoratorUsedOnClassWithEmptyReasonz€
    All tests should be skipped because @skipIf decorator is used on
    this class, even if the reason is an empty string
    Nr   c                 C   s   t dƒ‚d S r   r   r
   r   r   r   r   #   s    z=SkipDecoratorUsedOnClassWithEmptyReason.test_shouldNeverRun_1c                 C   s   t dƒ‚d S r   r   r
   r   r   r   r   &   s    z=SkipDecoratorUsedOnClassWithEmptyReason.test_shouldNeverRun_2r   r   r   r   r   r      s   r   c                   @   s~   e Zd ZdZeddƒddœdd„ƒZeddƒddœd	d
„ƒZddœdd„Zeddƒddœdd„ƒZeddƒddœdd„ƒZ	dS )ÚSkipDecoratorUsedOnMethodsúI
    Only methods where @skipIf decorator is used should be skipped.
    Tz"skipIf decorator used so skip testNr   c                 C   s   t dƒ‚d S r   r   r
   r   r   r   Útest_shouldNeverRun/   s    z.SkipDecoratorUsedOnMethods.test_shouldNeverRunr   c                 C   s   t dƒ‚d S r   r   r
   r   r   r   Ú"test_shouldNeverRunWithEmptyReason3   s    z=SkipDecoratorUsedOnMethods.test_shouldNeverRunWithEmptyReasonc                 C   s   |   dd¡ d S ©NTz"Test should run and not be skipped©Ú
assertTruer
   r   r   r   Útest_shouldShouldRun7   s    z/SkipDecoratorUsedOnMethods.test_shouldShouldRunFzshould not skipc                 C   s   |   dd¡ d S r   r   r
   r   r   r   Ú#test_shouldShouldRunWithSkipIfFalse:   s    z>SkipDecoratorUsedOnMethods.test_shouldShouldRunWithSkipIfFalsec                 C   s   |   dd¡ d S r   r   r
   r   r   r   Ú.test_shouldShouldRunWithSkipIfFalseEmptyReason>   s    zISkipDecoratorUsedOnMethods.test_shouldShouldRunWithSkipIfFalseEmptyReason)
r   r   r   r   r   r   r   r   r   r    r   r   r   r   r   *   s   r   c                   @   s0   e Zd ZdZdZddœdd„Zddœdd„ZdS )	ÚSkipAttributeOnClasszV
    All tests should be skipped because skip attribute is set on
    this class.
    z5'skip' attribute set on this class, so skip all testsNr   c                 C   s   t dƒ‚d S r   r   r
   r   r   r   Útest_oneK   s    zSkipAttributeOnClass.test_onec                 C   s   t dƒ‚d S r   r   r
   r   r   r   Útest_twoN   s    zSkipAttributeOnClass.test_two)r   r   r   r   Úskipr"   r#   r   r   r   r   r!   C   s   r!   c                   @   s2   e Zd ZdZddœdd„Zde_ddœdd„ZdS )	ÚSkipAttributeOnMethodsr   Nr   c                 C   s   t dƒ‚d S )NzShould never reach herer   r
   r   r   r   r"   W   s    zSkipAttributeOnMethods.test_onez'skip test, skip attribute set on methodc                 C   s   |   dd¡ d S r   r   r
   r   r   r   Útest_shouldNotSkip\   s    z)SkipAttributeOnMethods.test_shouldNotSkip)r   r   r   r   r"   r$   r&   r   r   r   r   r%   R   s   r%   N)
r   Zunittestr   Ztwisted.trial.unittestr   r   r   r   r!   r%   r   r   r   r   Ú<module>   s   