o
    ¼>h  ã                   @   sF   d Z ddl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.
é    N)ÚitrialÚreporterÚrunnerÚunittest)Úmockdoctestc                   @   sV   e Zd ZdZddd„Zddd„Zdejddfd	d
„Zdde	ddfdd„Z
ddd„ZdS )ÚRunnersTestsz.
    Tests for Twisted's doctest support.
    ÚreturnNc                 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   ú/var/www/vedio/testing/chatpythonscript.ninositsolution.com/env/lib/python3.10/site-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_basicTrialIntegrationr   c                 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é   Úcountc                 C   s   t  ¡  t¡}|  |¡ dS )zL
        Trial can correctly run doctests with its xUnit test APIs.
        N©r   r	   r
   r   r#   )r   r%   r   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_repeatable)r   N)r$   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   ÚpyunitÚ	TestSuiter#   Úintr'   r(   r   r   r   r   r      s    

	r   )r,   r   r-   Útwisted.trialr   r   r   Útwisted.trial.testr   ÚSynchronousTestCaser   r   r   r   r   Ú<module>   s
   