Current File : //lib/python3/dist-packages/twisted/trial/test/__pycache__/test_doctest.cpython-312.pyc |
�
Ϫ�f � �^ � d Z ddlZddlmZmZmZmZ ddlmZ G d� dej � Z
y)z!
Test Twisted's doctest support.
� N)�itrial�reporter�runner�unittest)�mockdoctestc �^ � e Zd ZdZdd�Zdd�Zdej ddfd�Zdde ddfd �Z
dd
�Zy)
�RunnersTestsz.
Tests for Twisted's doctest support.
�returnNc �� � t j � }|j t � }d}|j D ]5 }| j |t
j |� j � � �7 y)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�tests �A/usr/lib/python3/dist-packages/twisted/trial/test/test_doctest.py�test_idzRunnersTests.test_id s^ � �
�"�"�$���#�#�K�0��;���L�L� A�D��M�M�(�F�$4�$4�T�$:�$=�$=�$?�@� A� c � � t j � }|j t � }| j d|j � � y)zP
L{loadDoctests} loads all of the doctests in the given module.
� N)r r r
r �assertEqual�countTestCases)r r r s r �test_basicTrialIntegrationz'RunnersTests.test_basicTrialIntegration s; � � �"�"�$���#�#�K�0������E�0�0�2�3r r c �� � t j � }|j |� | j d|j � | j dt |j � � y)z4
Run C{suite} and check the result.
� � N)r �
TestResult�runr � successes�len�failures)r r �results r �_testRunzRunnersTests._testRun% sM � � �$�$�&��
� � �&������F�,�,�-�����C����0�1r �countc �t � t j � j t � }| j |� y)zL
Trial can correctly run doctests with its xUnit test APIs.
N�r r r
r r( )r r) r s r �test_expectedResultsz!RunnersTests.test_expectedResults. s) � � �!�!�#�0�0��=���
�
�e�r c � � t j � j t � }| j |� | j |� y)z9
Doctests should be runnable repeatably.
Nr+ )r r s r �test_repeatablezRunnersTests.test_repeatable5 s5 � � �!�!�#�0�0��=���
�
�e���
�
�e�r )r
N)� )�__name__�
__module__�__qualname__�__doc__r r �pyunit� TestSuiter( �intr, r. � r r r r
sC � �� A�4�2�f�.�.� 2�4� 2��#� �d� �r r )r3 r r4 �
twisted.trialr r r �twisted.trial.testr �SynchronousTestCaser r7 r r �<module>r; s* ��� � <� <� *�.�8�/�/� .r