AnonSec Shell
Server IP : 209.38.156.173  /  Your IP : 216.73.216.122   [ Reverse IP ]
Web Server : Apache/2.4.52 (Ubuntu)
System : Linux lakekumayuhotel 5.15.0-136-generic #147-Ubuntu SMP Sat Mar 15 15:53:30 UTC 2025 x86_64
User : root ( 0)
PHP Version : 8.1.2-1ubuntu2.22
Disable Function : NONE
Domains : 2 Domains
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/lib/python3/dist-packages/twisted/trial/test/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     [ BACKUP SHELL ]     [ JUMPING ]     [ MASS DEFACE ]     [ SCAN ROOT ]     [ SYMLINK ]     

Current File : /usr/lib/python3/dist-packages/twisted/trial/test/__pycache__/test_pyunitcompat.cpython-310.pyc
o

�b��@s�ddlZddlZddlZddlmZddlmZddlmZddl	m
Z
mZddlm
Z
mZGdd�de�ZGd	d
�d
e�ZdS)�N)�skipIf)�implementer)�Failure)�	IReporter�	ITestCase)�PyUnitResultAdapter�SynchronousTestCasec@s.eZdZGdd�dej�Zdd�Zdd�ZdS)�PyUnitTestTestsc@seZdZdd�ZdS)zPyUnitTestTests.PyUnitTestcCsdS�N���selfrr�F/usr/lib/python3/dist-packages/twisted/trial/test/test_pyunitcompat.py�	test_passsz$PyUnitTestTests.PyUnitTest.test_passN)�__name__�
__module__�__qualname__rrrrr�
PyUnitTestsrcCs|�d�|_t|j�|_dS)Nr)r�originalr�testrrrr�setUpszPyUnitTestTests.setUpcCs|�t|j�|j�d��dS)zW
        Tests must be callable in order to be used with Python's unittest.py.
        z is not callable.N)�
assertTrue�callablerrrrr�
test_callableszPyUnitTestTests.test_callableN)rrr�pyunit�TestCaserrrrrrrr	sr	c@speZdZdZGdd�de�Zdd�Zdd�Zdd	�Zd
d�Z	dd
�Z
dd�Zdd�Zdd�Z
dd�Zdd�ZdS)�PyUnitResultTestsz�
    Tests to show that PyUnitResultAdapter wraps TestResult objects from the
    standard library 'unittest' module in such a way as to make them usable and
    useful from Trial.
    c@seZdZdZdZdd�ZdS)zPyUnitResultTests.ErrorTestz�
        A test case which has a L{test_foo} which will raise an error.

        @ivar ran: boolean indicating whether L{test_foo} has been run.
        FcCsd|_dddS)zR
            Set C{self.ran} to True and raise a C{ZeroDivisionError}
            T�rN��ranrrrr�test_foo3sz$PyUnitResultTests.ErrorTest.test_fooN)rrr�__doc__rr rrrr�	ErrorTest*sr"cCsFtt�Gdd�d��}|�d�}|�}|�|�|�|jdt�dS)z�
        The L{PyUnitResultAdapter} is only used when the result passed to
        C{run} does *not* provide L{IReporter}.
        c@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)zXPyUnitResultTests.test_dontUseAdapterWhenReporterProvidesIReporter.<locals>.StubReporterz�
            A reporter which records data about calls made to it.

            @ivar errors: Errors passed to L{addError}.
            @ivar failures: Failures passed to L{addFailure}.
            cSsg|_g|_dSr
)�errors�failuresrrrr�__init__Is
zaPyUnitResultTests.test_dontUseAdapterWhenReporterProvidesIReporter.<locals>.StubReporter.__init__cS�dS�z-
                Do nothing.
                Nr�r
rrrr�	startTestM�zbPyUnitResultTests.test_dontUseAdapterWhenReporterProvidesIReporter.<locals>.StubReporter.startTestcSr&r'rr(rrr�stopTestRr*zaPyUnitResultTests.test_dontUseAdapterWhenReporterProvidesIReporter.<locals>.StubReporter.stopTestcSs|j�|�dS)z3
                Record the error.
                N)r#�append)r
r�errorrrr�addErrorWszaPyUnitResultTests.test_dontUseAdapterWhenReporterProvidesIReporter.<locals>.StubReporter.addErrorN)rrrr!r%r)r+r.rrrr�StubReporter@sr/r rN)rrr"�run�assertIsInstancer#r)r
r/r�resultrrr�0test_dontUseAdapterWhenReporterProvidesIReporter:s

zBPyUnitResultTests.test_dontUseAdapterWhenReporterProvidesIReportercCsVGdd�dt�}|d�}t��}|�|�|�|j�|�d|j�|�|���dS)Nc@�eZdZdZdd�ZdS)z3PyUnitResultTests.test_success.<locals>.SuccessTestFcS�
d|_dS�NTr��srrrr f�
z<PyUnitResultTests.test_success.<locals>.SuccessTest.test_fooN�rrrrr rrrr�SuccessTestc�r;r r)	rr�
TestResultr0rr�assertEqual�testsRun�
wasSuccessful)r
r;rr2rrr�test_successbs
zPyUnitResultTests.test_successcCshGdd�dt�}|d�}t��}|�|�|�|j�|�d|j�|�dt|j	��|�
|���dS)Nc@r4)z3PyUnitResultTests.test_failure.<locals>.FailureTestFcSsd|_|�d�dS)NTzboom!)r�failr7rrrr usz<PyUnitResultTests.test_failure.<locals>.FailureTest.test_fooNr:rrrr�FailureTestrr<rCr r)rrr=r0rrr>r?�lenr$�assertFalser@)r
rCrr2rrr�test_failureqs
zPyUnitResultTests.test_failurecCsZ|�d�}t��}|�|�|�|j�|�d|j�|�dt|j	��|�
|���dS)Nr r)r"rr=r0rrr>r?rDr#rEr@)r
rr2rrr�
test_error�s

zPyUnitResultTests.test_errorcCshGdd�dt�}|d�}t��}|�|�|�|j�|�d|j�|�dt|j	��|�|�
��dS)Nc@s eZdZdZdd�Zdd�ZdS)z4PyUnitResultTests.test_setUpError.<locals>.ErrorTestFcS�dddS�Nrrrrrrrr�sz:PyUnitResultTests.test_setUpError.<locals>.ErrorTest.setUpcSr5r6rr7rrrr �r9z=PyUnitResultTests.test_setUpError.<locals>.ErrorTest.test_fooN)rrrrrr rrrrr"�sr"r r)rrr=r0rErr>r?rDr#r@)r
r"rr2rrr�test_setUpError�s	
z!PyUnitResultTests.test_setUpErrorcCspzddWntyt��}t�}Ynwt��}t|�}|�||�|�|j	ddd�
tj|���dS)z�
        Errors added through the L{PyUnitResultAdapter} have the same traceback
        information as if there were no adapter at all.
        rr�N)
�ZeroDivisionError�sys�exc_inforrr=rr.r>r#�join�	traceback�format_exception�r
rN�f�pyresultr2rrr�test_tracebackFromFailure�s
��z+PyUnitResultTests.test_tracebackFromFailurecCs�Gdd�dt�}|d�}t��}|�|�d�t�|jd��}d�|jdd�	�d	d
��}|�
|��|t|�d	����d	S)zG
        As test_tracebackFromFailure, but covering more code.
        c@seZdZdZdd�ZdS)z3PyUnitResultTests.test_traceback.<locals>.ErrorTestNcSs*zddWdStyt��|_�wrI)rLrMrNrrrrr �s
�z<PyUnitResultTests.test_traceback.<locals>.ErrorTest.test_foo)rrrrNr rrrrr"�r<r"r rK��
rrN���)
rrr=r0rOrP�	format_tbrNr#�
splitlinesr>�striprD)r
r"rr2�expected_stack�observed_stackrrr�test_traceback�s

	 �z PyUnitResultTests.test_tracebackcCsxzddWntyt��}t�}Ynw|��t��}t|�}|�||�|�	|j
ddd�tj
|���dS)z�
        Errors added through the L{PyUnitResultAdapter} have the same
        traceback information as if there were no adapter at all, even
        if the Failure that held the information has been cleaned.
        rrrKN)rLrMrNr�cleanFailurerr=rr.r>r#rOrPrQrRrrr�test_tracebackFromCleanFailure�s
��z0PyUnitResultTests.test_tracebackFromCleanFailurecC�BGdd�dt�}|d�}t��}|�|�|�|j|dfg�dS)zw
        Skips using trial's skipping functionality are reported as skips in
        the L{pyunit.TestResult}.
        c@seZdZedd�dd��ZdS)z2PyUnitResultTests.test_trialSkip.<locals>.SkipTestT�Let's skip!cSrHrIrrrrr�	test_skip��z<PyUnitResultTests.test_trialSkip.<locals>.SkipTest.test_skipN)rrrrrcrrrr�SkipTest��rercrbN�rrr=r0r>�skipped�r
rerr2rrr�test_trialSkip��

z PyUnitResultTests.test_trialSkipcCra)zx
        Skips using pyunit's skipping functionality are reported as skips in
        the L{pyunit.TestResult}.
        c@seZdZe�d�dd��ZdS)z3PyUnitResultTests.test_pyunitSkip.<locals>.SkipTest�skippycSrHrIrrrrrrc�rdz=PyUnitResultTests.test_pyunitSkip.<locals>.SkipTest.test_skipN)rrrr�skiprcrrrrre�rfrercrlNrgrirrr�test_pyunitSkip�rkz!PyUnitResultTests.test_pyunitSkipN)rrrr!rr"r3rArFrGrJrUr^r`rjrnrrrrr!s(
!r)rMrP�unittestrr�zope.interfacer�twisted.python.failurer�twisted.trial.itrialrr�twisted.trial.unittestrrr	rrrrr�<module>s

Anon7 - 2022
AnonSec Team