403Webshell
Server IP : 192.158.238.246  /  Your IP : 3.144.84.11
Web Server : LiteSpeed
System : Linux uniform.iwebfusion.net 4.18.0-553.27.1.lve.1.el8.x86_64 #1 SMP Wed Nov 20 15:58:00 UTC 2024 x86_64
User : jenniferflocom ( 1321)
PHP Version : 8.1.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /opt/alt/python37/lib/python3.7/site-packages/nose/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /opt/alt/python37/lib/python3.7/site-packages/nose/__pycache__/case.cpython-37.pyc
B

/�Se}3�@s�dZddlZddlZddlZddlmZddlmZddlm	Z	ddl
mZmZm
Z
e�e�ZdgZGdd�dej�ZGd	d
�d
ej�ZGdd�de�ZGd
d�de�ZdS)z�nose unittest.TestCase subclasses. It is not necessary to subclass these
classes when writing tests; they are used internally by nose.loader.TestLoader
to create test cases from test functions and methods in test classes.
�N)�
isfunction)�Config)�Failure)�resolve_name�test_address�try_run�Testc@s�eZdZdZdZddd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zeeddd�Zdd�Zdd�Zdd�ZdS) rz�The universal test case wrapper.

    When a plugin sees a test, it will always see an instance of this
    class. To access the actual test case that will be run, access the
    test property of the nose.case.Test instance.
    FNcCs^t|�std|��||_|dkr(t�}||_d|_d|_||_|j|_d|_	t
j�|�dS)NzTnose.case.Test called with argument %r that is not callable. A callable is required.)
�callable�	TypeError�testr�configZtbinfoZcapturedOutput�resultProxy�pluginsZpassed�unittest�TestCase�__init__)�selfrrr
�r�:/opt/alt/python37/lib/python3.7/site-packages/nose/case.pyrsz
Test.__init__cOs|j||�S)N)�run)r�arg�kwargrrr�__call__,sz
Test.__call__cCs"|j�|�}|dk	r|St|j�S)N)rZtestName�strr)r�namerrr�__str__/szTest.__str__cCs
d|jS)NzTest(%r))r)rrrr�__repr__5sz
Test.__repr__cCs.y
|j}Wntk
rYnX||j�dS)z>Called after test is complete (after result.stopTest)
        N)�	afterTest�AttributeErrorr)r�resultrrrrr8s

zTest.afterTestcCs.y
|j}Wntk
rYnX||j�dS)z<Called before test is run (before result.startTest)
        N)�
beforeTestrr)rrr rrrr Bs

zTest.beforeTestcCst��\}}}|||fS)z Extract exception info.
        )�sys�exc_info)r�excZexv�tbrrrr"Lsz
Test.exc_infocCs
|j��S)z0Get a short(er) description of the test
        )r�id)rrrrr%RszTest.idcCs$t|jd�r|j��St|j�SdS)z�Return a round-trip name for this test, a name that can be
        fed back as input to loadTestByName and (assuming the same
        plugin configuration) result in the loading of this test.
        �addressN)�hasattrrr&r)rrrrr&Ws
zTest.addresscCsby|jjStk
rYnXy|jjStk
r:YnXyt|jj�Stk
r\YnXdS)N)r�contextr�	__class__r�
__module__)rrrr�_contextbsz
Test._contextz-Get the context object of this test (if any).c	Csv|jr|�||�}zRy|�|�|�|�Wn4tk
rB�Yn t��}|�||�YnXWd|�|�XdS)aModified run for the test wrapper.

        From here we don't call result.startTest or stopTest or
        addSuccess.  The wrapper calls addError/addFailure only if its
        own setup or teardown fails, or running the wrapped test fails
        (eg, if the wrapped "test" is not callable).

        Two additional methods are called, beforeTest and
        afterTest. These give plugins a chance to modify the wrapped
        test before it is called and do cleanup after it is
        called. They are called unconditionally.
        N)r
r �runTest�KeyboardInterruptr!r"�addErrorr)rr�errrrrrss

zTest.runcCs,|j}|jj�|�}|dk	r |}||�dS)z�Run the test. Plugins may alter the test by returning a
        value from prepareTestCase. The value must be callable and
        must accept one argument, the result instance.
        N)rrrZprepareTestCase)rrrZ	plug_testrrrr,�s
zTest.runTestcCs�|j�|�}|dk	r|S|j}y|j��|_Wn:tk
rhy|j��|_Wntk
rbYnXYnXy|j��}Wntk
r�YnXy|t	|j�kr�dSWntk
r�YnX|S)N)
rZdescribeTestr�_testMethodDoc�striprZ_TestCase__testMethodDoc�shortDescription�	Exceptionr)r�descrrrrr2�s*zTest.shortDescription)NN)�__name__r*�__qualname__�__doc__�__test__rrrrrr r"r%r&r+�propertyr(rr,r2rrrrrs"


c@s,eZdZdZdZdd�Zdd�Zdd�Zd	S)
�TestBasezBCommon functionality for FunctionTestCase and MethodTestCase.
    FcCst|�S)N)r)rrrrr%�szTestBase.idcCs|j|j�dS)N)rr)rrrrr,�szTestBase.runTestcCsNt|jd�r|jjS|��\}}t|dd�}|s8t|�}|���d�d��S)N�descriptionr7�
r)r'rr;�_descriptors�getattrrr1�split)r�funcr�docrrrr2�szTestBase.shortDescriptionN)r5r*r6r7r8r%r,r2rrrrr:�s
r:c@sjeZdZdZdZdde�dfdd�Zdd�Zdd	�Ze	eddd
�Z
dd�Zd
d�Zdd�Z
e
Zdd�ZdS)�FunctionTestCasez�TestCase wrapper for test functions.

    Don't use this class directly; it is used internally in nose to
    create test cases for test functions.
    FNcCs,||_||_||_||_||_t�|�dS)aInitialize the MethodTestCase.

        Required argument:

        * test -- the test function to call.

        Optional arguments:

        * setUp -- function to run at setup.

        * tearDown -- function to run at teardown.

        * arg -- arguments to pass to the test function. This is to support
          generator functions that yield arguments.

        * descriptor -- the function, other than the test, that should be used
          to construct the test name. This is to support generator functions.
        N)r�	setUpFunc�tearDownFuncr�
descriptorr:r)rr�setUp�tearDownrrErrrr�szFunctionTestCase.__init__cCs"|jdk	rt|j�St|j�SdS)z�Return a round-trip name for this test, a name that can be
        fed back as input to loadTestByName and (assuming the same
        plugin configuration) result in the loading of this test.
        N)rErr)rrrrr&�s

zFunctionTestCase.addresscCst|jj�S)N)rrr*)rrrrr+�szFunctionTestCase._contextz!Get context (module) of this testcCs$|jr|��nd}t|j|�dS)z=Run any setup function attached to the test function
        )�setuprFrCN)rCrr)r�namesrrrrFs
zFunctionTestCase.setUpcCs$|jr|��nd}t|j|�dS)z@Run any teardown function attached to the test function
        )�teardownrGrDN)rDrr)rrIrrrrG
s
zFunctionTestCase.tearDowncCsF|��\}}t|d�r|j}n|j}d|j|f}|rBd||f}|S)N�compat_func_namez%s.%sz%s%s)r=r'rKr5r*)rr@rrrrrrs
zFunctionTestCase.__str__cCs"|jr|j|jfS|j|jfSdS)afGet the descriptors of the test function: the function and
        arguments that will be used to construct the test name. In
        most cases, this is the function itself and no arguments. For
        tests generated by generator functions, the original
        (generator) function and args passed to the generated function
        are returned.
        N)rErr)rrrrr=%szFunctionTestCase._descriptors)r5r*r6r7r8�tuplerr&r+r9r(rFrGrrr=rrrrrB�s
		
rBc@sheZdZdZdZde�dfdd�Zdd�ZeZdd	�Z	d
d�Z
ee
ddd�Zd
d�Z
dd�Zdd�ZdS)�MethodTestCasez�Test case wrapper for test methods.

    Don't use this class directly; it is used internally in nose to
    create test cases for test methods.
    FNcCsj||_||_||_||_t|�r(td��|jj|_|��|_	|jdkr\|jj
}t|j	|�|_t�
|�dS)a�Initialize the MethodTestCase.

        Required argument:

        * method -- the method to call, may be bound or unbound. In either
          case, a new instance of the method's class will be instantiated to
	  make the call.  Note: In Python 3.x, if using an unbound method, you
	  must wrap it using pyversion.unbound_method.

        Optional arguments:

        * test -- the test function to call. If this is passed, it will be
          called instead of getting a new bound method of the same name as the
          desired method from the test instance. This is to support generator
          methods that yield inline functions.

        * arg -- arguments to pass to the test function. This is to support
          generator methods that yield arguments.

        * descriptor -- the function, other than the test, that should be used
          to construct the test name. This is to support generator methods.
        z_Unbound methods must be wrapped using pyversion.unbound_method before passing to MethodTestCaseN)�methodrrrEr�
ValueError�__self__r)�cls�instr5r>r:r)rrNrrrE�method_namerrrr;s


zMethodTestCase.__init__cCsN|��\}}t|d�r|j}n|j}d|jj|jj|f}|rJd||f}|S)NrKz%s.%s.%sz%s%s)r=r'rKr5rQr*)rr@rrrrrr_s
zMethodTestCase.__str__cCs"|jdk	rt|j�St|j�SdS)z�Return a round-trip name for this test, a name that can be
        fed back as input to loadTestByName and (assuming the same
        plugin configuration) result in the loading of this test.
        N)rErrN)rrrrr&ms

zMethodTestCase.addresscCs|jS)N)rQ)rrrrr+wszMethodTestCase._contextz Get context (class) of this testcCst|jd�dS)N)rHrF)rrR)rrrrrF|szMethodTestCase.setUpcCst|jd�dS)N)rJrG)rrR)rrrrrGszMethodTestCase.tearDowncCs"|jr|j|jfS|j|jfSdS)agGet the descriptors of the test method: the method and
        arguments that will be used to construct the test name. In
        most cases, this is the method itself and no arguments. For
        tests generated by generator methods, the original
        (generator) method and args passed to the generated method 
        or function are returned.
        N)rErrN)rrrrr=�szMethodTestCase._descriptors)r5r*r6r7r8rLrrrr&r+r9r(rFrGr=rrrrrM3s$
rM)r7�loggingr!r�inspectrZnose.configrZnose.failurerZ	nose.utilrrr�	getLoggerr5�log�__all__rrr:rBrMrrrr�<module>s
*b

Youez - 2016 - github.com/yon3zu
LinuXploit