o
    ¯b±  ã                   @   s>   d Z ddlmZmZmZmZ ddlmZ G dd„ dejƒZ	dS )z!
Test Twisted's doctest support.
é    )ÚitrialÚreporterÚrunnerÚunittest)Úmockdoctestc                   @   s:   e Zd ZdZdd„ Zdd„ Zdd„ Zdd	d
„Zdd„ ZdS )ÚRunnersTestsz.
    Tests for Twisted's doctest support.
    c                 C   s<   t  ¡ }| t¡}d}|jD ]}|  |t |¡ ¡ ¡ qdS )zq
        Check that the id() of the doctests' case object contains the FQPN of
        the actual tests.
        z&twisted.trial.test.mockdoctest.CounterN)	r   Ú
TestLoaderÚloadDoctestsr   Ú_testsÚassertInr   Ú	ITestCaseÚid)ÚselfÚloaderÚsuiteÚidPrefixÚtest© r   úA/usr/lib/python3/dist-packages/twisted/trial/test/test_doctest.pyÚtest_id   s   

ÿzRunnersTests.test_idc                 C   s&   t  ¡ }| t¡}|  d| ¡ ¡ dS )zP
        L{loadDoctests} loads all of the doctests in the given module.
        é   N)r   r   r	   r   ÚassertEqualÚcountTestCases)r   r   r   r   r   r   Útest_basicTrialIntegration   s   
z'RunnersTests.test_basicTrialIntegrationc                 C   s6   t  ¡ }| |¡ |  d|j¡ |  dt|jƒ¡ dS )z4
        Run C{suite} and check the result.
        é   é   N)r   Ú
TestResultÚrunr   Ú	successesÚlenÚfailures)r   r   Úresultr   r   r   Ú_testRun%   s   
zRunnersTests._testRuné   c                 C   s   t  ¡  t¡}|  |¡ dS )zL
        Trial can correctly run doctests with its xUnit test APIs.
        N©r   r   r	   r   r"   )r   Úcountr   r   r   r   Útest_expectedResults.   s   z!RunnersTests.test_expectedResultsc                 C   s&   t  ¡  t¡}|  |¡ |  |¡ dS )z9
        Doctests should be runnable repeatably.
        Nr$   )r   r   r   r   r   Útest_repeatable5   s   
zRunnersTests.test_repeatableN)r#   )	Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r"   r&   r'   r   r   r   r   r      s    
	r   N)
r+   Útwisted.trialr   r   r   r   Útwisted.trial.testr   ÚSynchronousTestCaser   r   r   r   r   Ú<module>   s   