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. """ Test L{twisted.web.pages} """ from typing import cast from twisted.trial.unittest import SynchronousTestCase from twisted.web.http_headers import Headers from twisted.web.iweb import IRequest from twisted.web.pages import errorPage, forbidden, notFound from twisted.web.resource import IResource from twisted.web.test.requesthelper import DummyRequest def _render(resource: IResource) -> DummyRequest: """ Render a response using the given resource. @param resource: The resource to use to handle the request. @returns: The request that the resource handled, """ request = DummyRequest([b""]) # The cast is necessary because DummyRequest isn't annotated # as an IRequest, and this can't be trivially done. See # https://github.com/twisted/twisted/issues/11719 resource.render(cast(IRequest, request)) return request class ErrorPageTests(SynchronousTestCase): """ Test L{twisted.web.pages._ErrorPage} and its public aliases L{errorPage}, L{notFound} and L{forbidden}. """ maxDiff = None def assertResponse(self, request: DummyRequest, code: int, body: bytes) -> None: self.assertEqual(request.responseCode, code) self.assertEqual( request.responseHeaders, Headers({b"content-type": [b"text/html; charset=utf-8"]}), ) self.assertEqual( # Decode to str because unittest somehow still doesn't diff bytes # without truncating them in 2022. b"".join(request.written).decode("latin-1"), body.decode("latin-1"), ) def test_escapesHTML(self) -> None: """ The I{brief} and I{detail} parameters are HTML-escaped on render. """ self.assertResponse( _render(errorPage(400, "A & B", "<script>alert('oops!')")), 400, ( b"<!DOCTYPE html>\n" b"<html><head><title>400 - A & B</title></head>" b"<body><h1>A & B</h1><p><script>alert('oops!')" b"</p></body></html>" ), ) def test_getChild(self) -> None: """ The C{getChild} method of the resource returned by L{errorPage} returns the L{_ErrorPage} it is called on. """ page = errorPage(404, "foo", "bar") self.assertIs( page.getChild(b"name", cast(IRequest, DummyRequest([b""]))), page, ) def test_notFoundDefaults(self) -> None: """ The default arguments to L{twisted.web.pages.notFound} produce a reasonable error page. """ self.assertResponse( _render(notFound()), 404, ( b"<!DOCTYPE html>\n" b"<html><head><title>404 - No Such Resource</title></head>" b"<body><h1>No Such Resource</h1>" b"<p>Sorry. No luck finding that resource.</p>" b"</body></html>" ), ) def test_forbiddenDefaults(self) -> None: """ The default arguments to L{twisted.web.pages.forbidden} produce a reasonable error page. """ self.assertResponse( _render(forbidden()), 403, ( b"<!DOCTYPE html>\n" b"<html><head><title>403 - Forbidden Resource</title></head>" b"<body><h1>Forbidden Resource</h1>" b"<p>Sorry, resource is forbidden.</p>" b"</body></html>" ), )