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 :  /lib/python3/dist-packages/twisted/web/test/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


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

Current File : /lib/python3/dist-packages/twisted/web/test/__pycache__/_util.cpython-310.pyc
o

�bf�@s�dZddlmZddlmZmZddlmZddlm	Z	ddl
mZddlm
Z
ddlmZd	d
�ZGdd�de�Zd
d�Zgd�ZdS)z0
General helpers for L{twisted.web} unit tests.
�)�Type)�Deferred�succeed)�SynchronousTestCase)�server)�
flattenString)�FlattenerError)�FlattenablecCs\|�|�}t|t�r|�|�|��td�S|tjur'|jr#td�S|�	�St
d|����)NzUnexpected return value: )�render�
isinstance�bytes�write�finishrr�NOT_DONE_YET�finished�notifyFinish�
ValueError)�resource�request�result�r�8/usr/lib/python3/dist-packages/twisted/web/test/_util.py�_renders



rc@sZeZdZdZdededeefdd�Zdededefdd�Zded	e	e
dd
fdd�Zd
S)
�FlattenTestCasezH
    A test case that assists with testing L{twisted.web._flatten}.
    �root�target�returncs0dtdtf��fdd�}td|�}|�|�|S)zS
        Assert that a root element, when flattened, is equal to a string.
        rrcs��|��S)N)�assertEqual)r��selfrrr�check,sz/FlattenTestCase.assertFlattensTo.<locals>.checkN)rr�addCallback)rrrr �drrr�assertFlattensTo's

z FlattenTestCase.assertFlattensTocCs|�|�||��S)a�
        Assert that a root element, when flattened, is equal to a string, and
        performs no asynchronus Deferred anything.

        This version is more convenient in tests which wish to make multiple
        assertions about flattening, since it can be called multiple times
        without having to add multiple callbacks.

        @return: the result of rendering L{root}, which should be equivalent to
            L{target}.
        @rtype: L{bytes}
        )�successResultOfr#)rrrrrr�assertFlattensImmediately3s
z)FlattenTestCase.assertFlattensImmediately�exnNcCs(|�|�|d�t�}|�|jj|�dS)zQ
        Assert flattening a root element raises a particular exception.
        �N)�failureResultOfr#r�assertIsInstance�value�
_exception)rrr&�failurerrr�assertFlatteningRaisesBsz&FlattenTestCase.assertFlatteningRaises)�__name__�
__module__�__qualname__�__doc__r	rrr#r%r�	Exceptionr-rrrrr"s
rcCs|�|��t�dS)z�
    Assert that C{fileObj} is a temporary file on the filesystem.

    @param case: A C{TestCase} instance to use to make the assertion.

    @raise: C{case.failureException} if C{fileObj} is not a temporary file on
        the filesystem.
    N)r)�fileno�int)�case�fileObjrrr�assertIsFilesystemTemporaryJsr7)rrr7N)r1�typingr�twisted.internet.deferrr�twisted.trial.unittestr�twisted.webr�twisted.web._flattenr�twisted.web.errorr�twisted.web.templater	rrr7�__all__rrrr�<module>s(

Anon7 - 2022
AnonSec Team