Linux cyberpanel 5.15.0-156-generic #166-Ubuntu SMP Sat Aug 9 00:02:46 UTC 2025 x86_64
LiteSpeed
: 160.191.175.3 | : 216.73.216.114
Cant Read [ /etc/named.conf ]
8.2.29
aodai6801
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
README
+ Create Folder
+ Create File
/
usr /
lib /
python3 /
dist-packages /
twisted /
web /
test /
[ HOME SHELL ]
Name
Size
Permission
Action
__pycache__
[ DIR ]
drwxr-xr-x
__init__.py
107
B
-rw-r--r--
_util.py
3.1
KB
-rw-r--r--
injectionhelpers.py
5.46
KB
-rw-r--r--
requesthelper.py
14.77
KB
-rw-r--r--
test_agent.py
118.21
KB
-rw-r--r--
test_cgi.py
14.76
KB
-rw-r--r--
test_client.py
1.33
KB
-rw-r--r--
test_distrib.py
17.61
KB
-rw-r--r--
test_domhelpers.py
10.78
KB
-rw-r--r--
test_error.py
15.57
KB
-rw-r--r--
test_flatten.py
21.61
KB
-rw-r--r--
test_html.py
1.19
KB
-rw-r--r--
test_http.py
151.87
KB
-rw-r--r--
test_http2.py
105.32
KB
-rw-r--r--
test_http_headers.py
22.75
KB
-rw-r--r--
test_httpauth.py
23.23
KB
-rw-r--r--
test_newclient.py
106.8
KB
-rw-r--r--
test_proxy.py
19.58
KB
-rw-r--r--
test_resource.py
8.92
KB
-rw-r--r--
test_script.py
3.72
KB
-rw-r--r--
test_soap.py
3.06
KB
-rw-r--r--
test_stan.py
7.08
KB
-rw-r--r--
test_static.py
66.6
KB
-rw-r--r--
test_tap.py
11.56
KB
-rw-r--r--
test_template.py
28.17
KB
-rw-r--r--
test_util.py
14.7
KB
-rw-r--r--
test_vhost.py
7.55
KB
-rw-r--r--
test_web.py
67.52
KB
-rw-r--r--
test_web__responses.py
829
B
-rw-r--r--
test_webclient.py
11.52
KB
-rw-r--r--
test_wsgi.py
74.72
KB
-rw-r--r--
test_xml.py
41.04
KB
-rw-r--r--
test_xmlrpc.py
29.86
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : _util.py
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ General helpers for L{twisted.web} unit tests. """ from typing import Type from twisted.internet.defer import Deferred, succeed from twisted.trial.unittest import SynchronousTestCase from twisted.web import server from twisted.web._flatten import flattenString from twisted.web.error import FlattenerError from twisted.web.template import Flattenable def _render(resource, request): result = resource.render(request) if isinstance(result, bytes): request.write(result) request.finish() return succeed(None) elif result is server.NOT_DONE_YET: if request.finished: return succeed(None) else: return request.notifyFinish() else: raise ValueError(f"Unexpected return value: {result!r}") class FlattenTestCase(SynchronousTestCase): """ A test case that assists with testing L{twisted.web._flatten}. """ def assertFlattensTo(self, root: Flattenable, target: bytes) -> Deferred[bytes]: """ Assert that a root element, when flattened, is equal to a string. """ def check(result: bytes) -> bytes: return self.assertEqual(result, target) # type: ignore[no-any-return] d: Deferred[bytes] = flattenString(None, root) d.addCallback(check) return d def assertFlattensImmediately(self, root: Flattenable, target: bytes) -> bytes: """ 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} """ return self.successResultOf(self.assertFlattensTo(root, target)) # type: ignore[no-any-return] def assertFlatteningRaises(self, root: Flattenable, exn: Type[Exception]) -> None: """ Assert flattening a root element raises a particular exception. """ failure = self.failureResultOf(self.assertFlattensTo(root, b""), FlattenerError) self.assertIsInstance(failure.value._exception, exn) def assertIsFilesystemTemporary(case, fileObj): """ 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. """ # The tempfile API used to create content returns an instance of a # different type depending on what platform we're running on. The point # here is to verify that the request body is in a file that's on the # filesystem. Having a fileno method that returns an int is a somewhat # close approximation of this. -exarkun case.assertIsInstance(fileObj.fileno(), int) __all__ = ["_render", "FlattenTestCase", "assertIsFilesystemTemporary"]
Close