o
    ¼>he  ã                   @   sZ   d Z ddlZddlmZ ddlmZ G dd„ dejƒZG dd„ dƒZG d	d
„ d
ejƒZ	dS )zÔ
Sample test cases defined using the standard library L{unittest.TestCase}
class which are used as data by test cases which are actually part of the
trial test suite to verify handling of handling of such cases.
é    N)Úexc_info)ÚFailurec                   @   s6   e Zd Zdd„ Zdd„ Zdd„ Ze d¡dd	„ ƒZd
S )Ú
PyUnitTestc                 C   ó   dS )z!
        A passing test.
        N© ©Úselfr   r   ú~/var/www/vedio/testing/chatpythonscript.ninositsolution.com/env/lib/python3.10/site-packages/twisted/trial/test/pyunitcases.pyÚ	test_pass   ó    zPyUnitTest.test_passc                 C   s   t dƒ‚)zE
        A test which raises an exception to cause an error.
        zpyunit error)Ú	Exceptionr   r   r   r	   Ú
test_error   s   zPyUnitTest.test_errorc                 C   s   |   d¡ dS )zQ
        A test which uses L{unittest.TestCase.fail} to cause a failure.
        zpyunit failureN)Úfailr   r   r   r	   Ú	test_fail   s   zPyUnitTest.test_failzpyunit skipc                 C   r   )zS
        A test which uses the L{unittest.skip} decorator to cause a skip.
        Nr   r   r   r   r	   Ú	test_skip"   r   zPyUnitTest.test_skipN)	Ú__name__Ú
__module__Ú__qualname__r
   r   r   ÚunittestÚskipr   r   r   r   r	   r      s    r   c                   @   s   e Zd ZdZdefdd„ZdS )Ú_NonStringIdzÚ
    A class that looks a little like a TestCase, but not enough so to
    actually be used as one.  This helps L{BrokenRunInfrastructure} use some
    interfaces incorrectly to provoke certain failure conditions.
    Úreturnc                 C   s   t ƒ S )N)Úobjectr   r   r   r	   Úid0   s   z_NonStringId.idN)r   r   r   Ú__doc__r   r   r   r   r   r	   r   )   s    r   c                   @   sH   e Zd ZdZdd„ Zdd„ Zdd„ Zdd	„ Zd
d„ Zdd„ Z	dd„ Z
dS )ÚBrokenRunInfrastructurezu
    A test suite that is broken at the level of integration between
    L{TestCase.run} and the results object.
    c                 C   s   t | | jƒ|ƒS )zß
        Override the normal C{run} behavior to pass the result object
        along to the test method.  Each test method needs the result object so
        that it can implement its particular kind of brokenness.
        )ÚgetattrÚ_testMethodName©r   Úresultr   r   r	   Úrun:   s   zBrokenRunInfrastructure.runc                 C   ó   |  tƒ ¡ dS )zA
        Violate the L{TestResult.addSuccess} interface.
        N)Ú
addSuccessr   r   r   r   r	   Útest_addSuccessB   s   z'BrokenRunInfrastructure.test_addSuccessc                 C   ó4   zt dƒ‚ ty   tƒ }Y nw | tƒ |¡ dS )z?
        Violate the L{TestResult.addError} interface.
        Útest_addErrorN)r   ÚBaseExceptionr   ÚaddErrorr   ©r   r   Úerrr   r   r	   r%   I   ó   
ÿz%BrokenRunInfrastructure.test_addErrorc                 C   r$   )zA
        Violate the L{TestResult.addFailure} interface.
        Útest_addFailureN)r   r&   r   Ú
addFailurer   r(   r   r   r	   r+   T   r*   z'BrokenRunInfrastructure.test_addFailurec                 C   s   |  tƒ d¡ dS )z>
        Violate the L{TestResult.addSkip} interface.
        Útest_addSkipN)ÚaddSkipr   r   r   r   r	   r-   _   s   z$BrokenRunInfrastructure.test_addSkipc                 C   r$   )zI
        Violate the L{TestResult.addExpectedFailure} interface.
        Útest_addExpectedFailureN)r   r&   r   ÚaddExpectedFailurer   r(   r   r   r	   r/   e   s   
ÿz/BrokenRunInfrastructure.test_addExpectedFailurec                 C   r!   )zK
        Violate the L{TestResult.addUnexpectedSuccess} interface.
        N)ÚaddUnexpectedSuccessr   r   r   r   r	   Útest_addUnexpectedSuccesso   s   z1BrokenRunInfrastructure.test_addUnexpectedSuccessN)r   r   r   r   r    r#   r%   r+   r-   r/   r2   r   r   r   r	   r   4   s    
r   )
r   r   Úsysr   Útwisted.python.failurer   ÚTestCaser   r   r   r   r   r   r	   Ú<module>   s   