o
    ¯bÁ  ã                   @   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   úB/usr/lib/python3/dist-packages/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   Ú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                   @   ó   e Zd ZG dd„ deƒZdS )ÚSynchronousTestCaseTestsc                   @   ó   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   ó   d S ©Nr   r	   r   r   r   r   6   ó   z*SynchronousTestCaseTests.MyTestCase.test_1N©r   r   r   r   r   r   r   r   r   r   0   ó    r   N)r   r   r   r   r   r   r   r   r   r   /   ó    r   c                   @   r   )ÚAsynchronousTestCaseTestsc                   @   r   )z$AsynchronousTestCaseTests.MyTestCasez_
        Some test methods which can be used to test behaviors of
        L{TestCase}.
        c                 C   r   r   r   r	   r   r   r   r   C   r   z+AsynchronousTestCaseTests.MyTestCase.test_1Nr    r   r   r   r   r   =   r!   r   N)r   r   r   r   r   r   r   r   r   r#   <   r"   r#   N)r   Útwisted.trial.unittestr   r   r   r   r#   r   r   r   r   Ú<module>   s
   "