403Webshell
Server IP : 46.62.235.243  /  Your IP : 216.73.216.163
Web Server : Apache/2.4.58 (Ubuntu)
System : Linux Linkabili3Dicembre 6.8.0-100-generic #100-Ubuntu SMP PREEMPT_DYNAMIC Tue Jan 13 16:40:06 UTC 2026 x86_64
User : www-data ( 33)
PHP Version : 8.1.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/twisted/web/test/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

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

oj

���dZddlmZddlmZddlmZmZddlm	Z	ddl
mZddlm
Z
ddlmZdd	lmZdd
lmZddlmZdd
lmZdd�ZGd�de	�Zd�Zgd�Zy)z0
General helpers for L{twisted.web} unit tests.
�)�annotations)�Type)�Deferred�succeed)�SynchronousTestCase)�server)�
flattenString)�FlattenerError)�Request)�	IResource)�Flattenable�)�DummyRequestc�*�|j|�}t|t�r,|j|�|j	�td�S|tjur'|jrtd�S|j�Std|����)NzUnexpected return value: )�render�
isinstance�bytes�write�finishrr�NOT_DONE_YET�finished�notifyFinish�
ValueError)�resource�request�results   �8/usr/lib/python3/dist-packages/twisted/web/test/_util.py�_renderrs}��
�_�_�W�
%�F��&�%� ��
�
�f�������t�}��	�6�&�&�	&�����4�=� ��'�'�)�)��4�V�J�?�@�@�c�(�eZdZdZdd�Zdd�Zdd�Zy)	�FlattenTestCasezH
    A test case that assists with testing L{twisted.web._flatten}.
    c�R���d��fd�}td|�}|j|�|S)zS
        Assert that a root element, when flattened, is equal to a string.
        c�,���j|��|S)N)�assertEqual)r�self�targets ��r�checkz/FlattenTestCase.assertFlattensTo.<locals>.check/s������V�V�,��MrN)rr�returnr)r	�addCallback)r%�rootr&r'�ds` `  r�assertFlattensToz FlattenTestCase.assertFlattensTo*s'���
	�+�4��6��	�
�
�e���rc�D�|j|j||��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,)r%r*r&s   r�assertFlattensImmediatelyz)FlattenTestCase.assertFlattensImmediately7s"���#�#�D�$9�$9�$��$G�H�Hrc��|j|j|d�t�}|j|jj
|�y)zQ
        Assert flattening a root element raises a particular exception.
        rN)�failureResultOfr,r
�assertIsInstance�value�
_exception)r%r*�exn�failures    r�assertFlatteningRaisesz&FlattenTestCase.assertFlatteningRaisesFs=���&�&�t�'<�'<�T�3�'G��X�����g�m�m�6�6��<rN)r*r
r&rr(zDeferred[bytes])r*r
r&rr(r)r*r
r5zType[Exception]r(�None)�__name__�
__module__�__qualname__�__doc__r,r/r7�rrr!r!%s����
I�=rr!c�L�|j|j�t�y)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)r2�fileno�int)�case�fileObjs  r�assertIsFilesystemTemporaryrCNs��	���'�.�.�*�C�0r)rr!rCN)rrrzRequest | DummyRequestr(zDeferred[None])r<�
__future__r�typingr�twisted.internet.deferrr�twisted.trial.unittestr�twisted.webr�twisted.web._flattenr	�twisted.web.errorr
�twisted.web.httpr�twisted.web.resourcer�twisted.web.templater
�
requesthelperrrr!rC�__all__r=rr�<module>rPsN���#��4�6��.�,�$�*�,�'�A�&=�)�&=�R1�"H�r

Youez - 2016 - github.com/yon3zu
LinuXploit