| Server IP : 139.59.63.204 / Your IP : 216.73.217.62 Web Server : Apache/2.4.58 (Ubuntu) System : Linux ubuntu-s-1vcpu-1gb-blr1-01 6.8.0-110-generic #110-Ubuntu SMP PREEMPT_DYNAMIC Thu Mar 19 15:09:20 UTC 2026 x86_64 User : root ( 0) PHP Version : 8.3.6 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /usr/lib/python3/dist-packages/twisted/web/test/__pycache__/ |
Upload File : |
�
oj� � � � d Z ddlZddlmZ ddlmZ ddlmZ ddlm Z ddl
mZmZ ddl
mZ dd lmZ G d
� de� Z G d� d
e� Zy)z"
Tests for L{twisted.web.script}.
� N)�defer)�FilePath)�TestCase)� NOT_FOUND)�PythonScript�ResourceScriptDirectory)�_render)�DummyRequestc � � e Zd ZdZdej
d fd�Zdej
d fd�Zdej
d fd�Zy)�ResourceScriptDirectoryTestsz/
Tests for L{ResourceScriptDirectory}.
�returnNc � � �� t � j � � }t dg� �t |�� }dt ddf�� fd�}|j |� S )zh
L{ResourceScriptDirectory.render} sets the HTTP response code to I{NOT
FOUND}.
� �ignoredr
Nc �F �� �j �j t � y �N��assertEqual�responseCoder �r �request�selfs ���>/usr/lib/python3/dist-packages/twisted/web/test/test_script.py�
cbRenderedzDResourceScriptDirectoryTests.test_renderNotFound.<locals>.cbRendered! � �� ����W�1�1�9�=r )r �mktempr
r �object�addCallback�r �resource�dr r s ` @r �test_renderNotFoundz0ResourceScriptDirectoryTests.test_renderNotFound sQ �� �
+�4�;�;�=�9����u�%���H�g�&�� >�� >�4� >� �}�}�Z�(�(r c � � �� � j � }t j |� t |� }t dg� �|j d�� }t
|�� }dt ddf�� fd�}|j |� S )a
L{ResourceScriptDirectory.getChild} returns a resource which renders an
response with the HTTP I{NOT FOUND} status code if the indicated child
does not exist as an entry in the directory used to initialized the
L{ResourceScriptDirectory}.
s foo�foor r
Nc �F �� �j �j t � y r r r s ��r r zCResourceScriptDirectoryTests.test_notFoundChild.<locals>.cbRendered4 r r ) r �os�makedirsr r
�getChildr r r )r �pathr �childr! r r s ` @r �test_notFoundChildz/ResourceScriptDirectoryTests.test_notFoundChild&