U
    2ÜŸjÁ  ã                   @   sJ   d Z ddlmZmZ G dd„ dƒZG dd„ deeƒZG dd„ deeƒZd	S )
zm
Direct unit tests for L{twisted.trial.unittest.SynchronousTestCase} and
L{twisted.trial.unittest.TestCase}.
é    )ÚSynchronousTestCaseÚTestCasec                   @   s(   e Zd ZdZdd„ Zdd„ Zdd„ ZdS )	ÚTestCaseMixinz
    L{TestCase} tests.
    c                 C   s   |   d¡| _|   d¡| _dS )z’
        Create a couple instances of C{MyTestCase}, each for the same test
        method, to be used in the test methods of this class.
        Útest_1N)Ú
MyTestCaseÚfirstÚsecond©Úself© r   úD/tmp/pip-unpacked-wheel-4b529toj/twisted/trial/test/test_testcase.pyÚsetUp   s    zTestCaseMixin.setUpc                 C   s:   |   | j| jk¡ |   | j| jk¡ |  | j| jk¡ dS )z�
        In order for one test method to be runnable twice, two TestCase
        instances with the same test method name must not compare as equal.
        N)Ú
assertTruer   r   ZassertFalser	   r   r   r   Útest_equality   s    zTestCaseMixin.test_equalityc                 C   s,   i }d|| j < d|| j< |  t|ƒd¡ dS )z¯
        In order for one test method to be runnable twice, two TestCase
        instances with the same test method name should not have the same
        hash value.
        Né   )r   r   ÚassertEqualÚlen)r
   Ú	containerr   r   r   Útest_hashability#   s    

zTestCaseMixin.test_hashabilityN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r   r   r   r      s   	r   c                   @   s   e Zd ZG dd„ deƒZdS )ÚSynchronousTestCaseTestsc                   @   s   e Zd ZdZdd„ ZdS )z#SynchronousTestCaseTests.MyTestCasezj
        Some test methods which can be used to test behaviors of
        L{SynchronousTestCase}.
        c                 C   s   d S ©Nr   r	   r   r   r   r   6   s    z*SynchronousTestCaseTests.MyTestCase.test_1N©r   r   r   r   r   r   r   r   r   r   0   s   r   N)r   r   r   r   r   r   r   r   r   r   /   s   r   c                   @   s   e Zd ZG dd„ deƒZdS )ÚAsynchronousTestCaseTestsc                   @   s   e Zd ZdZdd„ ZdS )z$AsynchronousTestCaseTests.MyTestCasez_
        Some test methods which can be used to test behaviors of
        L{TestCase}.
        c                 C   s   d S r   r   r	   r   r   r   r   C   s    z+AsynchronousTestCaseTests.MyTestCase.test_1Nr   r   r   r   r   r   =   s   r   N)r   r   r   r   r   r   r   r   r   r   <   s   r   N)r   Ztwisted.trial.unittestr   r   r   r   r   r   r   r   r   Ú<module>   s   "