Linux jobworks 6.8.0-136-generic #136-Ubuntu SMP PREEMPT_DYNAMIC Wed Jul 1 21:53:05 UTC 2026 x86_64
Apache/2.4.58 (Ubuntu)
Server IP : 10.0.1.5 & Your IP : 216.73.217.52
Domains :
Cant Read [ /etc/named.conf ]
User : www-data
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
usr /
lib /
python3 /
dist-packages /
twisted /
web /
test /
Delete
Unzip
Name
Size
Permission
Date
Action
__pycache__
[ DIR ]
drwxr-xr-x
2026-06-04 06:40
__init__.py
107
B
-rw-r--r--
2026-05-22 14:58
_util.py
3.26
KB
-rw-r--r--
2026-05-22 14:58
injectionhelpers.py
5.46
KB
-rw-r--r--
2026-05-22 14:58
requesthelper.py
15.07
KB
-rw-r--r--
2026-05-22 14:58
test_agent.py
119.75
KB
-rw-r--r--
2026-05-22 14:58
test_cgi.py
14.76
KB
-rw-r--r--
2026-05-22 14:58
test_client.py
1.52
KB
-rw-r--r--
2026-05-22 14:58
test_distrib.py
17.58
KB
-rw-r--r--
2026-05-22 14:58
test_domhelpers.py
11.18
KB
-rw-r--r--
2026-05-22 14:58
test_error.py
16.37
KB
-rw-r--r--
2026-05-22 14:58
test_flatten.py
25.67
KB
-rw-r--r--
2026-05-22 14:58
test_html.py
1.21
KB
-rw-r--r--
2026-05-22 14:58
test_http.py
153.63
KB
-rw-r--r--
2026-05-22 14:58
test_http2.py
105.17
KB
-rw-r--r--
2026-05-22 14:58
test_http_headers.py
24.38
KB
-rw-r--r--
2026-05-22 14:58
test_httpauth.py
23.23
KB
-rw-r--r--
2026-05-22 14:58
test_newclient.py
106.8
KB
-rw-r--r--
2026-05-22 14:58
test_pages.py
3.56
KB
-rw-r--r--
2026-05-22 14:58
test_proxy.py
19.57
KB
-rw-r--r--
2026-05-22 14:58
test_resource.py
10.37
KB
-rw-r--r--
2026-05-22 14:58
test_script.py
3.91
KB
-rw-r--r--
2026-05-22 14:58
test_soap.py
3.04
KB
-rw-r--r--
2026-05-22 14:58
test_stan.py
7.08
KB
-rw-r--r--
2026-05-22 14:58
test_static.py
66.6
KB
-rw-r--r--
2026-05-22 14:58
test_tap.py
11.86
KB
-rw-r--r--
2026-05-22 14:58
test_template.py
28.38
KB
-rw-r--r--
2026-05-22 14:58
test_util.py
14.76
KB
-rw-r--r--
2026-05-22 14:58
test_vhost.py
7.49
KB
-rw-r--r--
2026-05-22 14:58
test_web.py
67.52
KB
-rw-r--r--
2026-05-22 14:58
test_web__responses.py
837
B
-rw-r--r--
2026-05-22 14:58
test_webclient.py
11.52
KB
-rw-r--r--
2026-05-22 14:58
test_wsgi.py
73.83
KB
-rw-r--r--
2026-05-22 14:58
test_xml.py
42.28
KB
-rw-r--r--
2026-05-22 14:58
test_xmlrpc.py
29.85
KB
-rw-r--r--
2026-05-22 14:58
Save
Rename
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for L{twisted.web.script}. """ import os from twisted.internet import defer from twisted.python.filepath import FilePath from twisted.trial.unittest import TestCase from twisted.web.http import NOT_FOUND from twisted.web.script import PythonScript, ResourceScriptDirectory from twisted.web.test._util import _render from twisted.web.test.requesthelper import DummyRequest class ResourceScriptDirectoryTests(TestCase): """ Tests for L{ResourceScriptDirectory}. """ def test_renderNotFound(self) -> defer.Deferred[None]: """ L{ResourceScriptDirectory.render} sets the HTTP response code to I{NOT FOUND}. """ resource = ResourceScriptDirectory(self.mktemp()) request = DummyRequest([b""]) d = _render(resource, request) def cbRendered(ignored: object) -> None: self.assertEqual(request.responseCode, NOT_FOUND) return d.addCallback(cbRendered) def test_notFoundChild(self) -> defer.Deferred[None]: """ 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}. """ path = self.mktemp() os.makedirs(path) resource = ResourceScriptDirectory(path) request = DummyRequest([b"foo"]) child = resource.getChild("foo", request) d = _render(child, request) def cbRendered(ignored: object) -> None: self.assertEqual(request.responseCode, NOT_FOUND) return d.addCallback(cbRendered) def test_render(self) -> defer.Deferred[None]: """ L{ResourceScriptDirectory.getChild} returns a resource which renders a response with the HTTP 200 status code and the content of the rpy's C{request} global. """ tmp = FilePath(self.mktemp()) tmp.makedirs() tmp.child("test.rpy").setContent( b""" from twisted.web.resource import Resource class TestResource(Resource): isLeaf = True def render_GET(self, request): return b'ok' resource = TestResource()""" ) resource = ResourceScriptDirectory(tmp._asBytesPath()) request = DummyRequest([b""]) child = resource.getChild(b"test.rpy", request) d = _render(child, request) def cbRendered(ignored: object) -> None: self.assertEqual(b"".join(request.written), b"ok") return d.addCallback(cbRendered) class PythonScriptTests(TestCase): """ Tests for L{PythonScript}. """ def test_notFoundRender(self) -> defer.Deferred[None]: """ If the source file a L{PythonScript} is initialized with doesn't exist, L{PythonScript.render} sets the HTTP response code to I{NOT FOUND}. """ resource = PythonScript(self.mktemp(), None) request = DummyRequest([b""]) d = _render(resource, request) def cbRendered(ignored: object) -> None: self.assertEqual(request.responseCode, NOT_FOUND) return d.addCallback(cbRendered) def test_renderException(self) -> defer.Deferred[None]: """ L{ResourceScriptDirectory.getChild} returns a resource which renders a response with the HTTP 200 status code and the content of the rpy's C{request} global. """ tmp = FilePath(self.mktemp()) tmp.makedirs() child = tmp.child("test.epy") child.setContent(b'raise Exception("nooo")') resource = PythonScript(child._asBytesPath(), None) request = DummyRequest([b""]) d = _render(resource, request) def cbRendered(ignored: object) -> None: self.assertIn(b"nooo", b"".join(request.written)) return d.addCallback(cbRendered)