U
    
W[                     @   s\   d Z ddlmZmZ ddlmZmZ G dd de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}.
    )divisionabsolute_import)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)Z
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
   ZassertEquallen)r   Z	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   8   s    z*SynchronousTestCaseTests.MyTestCase.test_1Nr   r   r   r   r   r   r   r   r   r   3   s   r   N)r   r   r   r   r   r   r   r   r   r   2   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   E   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
__future__r   r   Ztwisted.trial.unittestr   r   objectr   r   r   r   r   r   r   <module>   s
   $