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 /
names /
test /
[ HOME SHELL ]
Name
Size
Permission
Action
__pycache__
[ DIR ]
drwxr-xr-x
__init__.py
26
B
-rw-r--r--
test_cache.py
5.45
KB
-rw-r--r--
test_client.py
40.53
KB
-rw-r--r--
test_common.py
4.03
KB
-rw-r--r--
test_dns.py
156.99
KB
-rw-r--r--
test_examples.py
5.2
KB
-rw-r--r--
test_hosts.py
9.67
KB
-rw-r--r--
test_names.py
47.84
KB
-rw-r--r--
test_resolve.py
1.05
KB
-rw-r--r--
test_rfc1982.py
13.51
KB
-rw-r--r--
test_rootresolve.py
25.05
KB
-rw-r--r--
test_server.py
40.69
KB
-rw-r--r--
test_srvconnect.py
9.2
KB
-rw-r--r--
test_tap.py
4.64
KB
-rw-r--r--
test_util.py
3.75
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : test_common.py
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for L{twisted.names.common}. """ from zope.interface.verify import verifyClass from twisted.internet.interfaces import IResolver from twisted.names.common import ResolverBase from twisted.names.dns import EFORMAT, ENAME, ENOTIMP, EREFUSED, ESERVER, Query from twisted.names.error import ( DNSFormatError, DNSNameError, DNSNotImplementedError, DNSQueryRefusedError, DNSServerError, DNSUnknownError, ) from twisted.python.failure import Failure from twisted.trial.unittest import SynchronousTestCase class ExceptionForCodeTests(SynchronousTestCase): """ Tests for L{ResolverBase.exceptionForCode}. """ def setUp(self): self.exceptionForCode = ResolverBase().exceptionForCode def test_eformat(self): """ L{ResolverBase.exceptionForCode} converts L{EFORMAT} to L{DNSFormatError}. """ self.assertIs(self.exceptionForCode(EFORMAT), DNSFormatError) def test_eserver(self): """ L{ResolverBase.exceptionForCode} converts L{ESERVER} to L{DNSServerError}. """ self.assertIs(self.exceptionForCode(ESERVER), DNSServerError) def test_ename(self): """ L{ResolverBase.exceptionForCode} converts L{ENAME} to L{DNSNameError}. """ self.assertIs(self.exceptionForCode(ENAME), DNSNameError) def test_enotimp(self): """ L{ResolverBase.exceptionForCode} converts L{ENOTIMP} to L{DNSNotImplementedError}. """ self.assertIs(self.exceptionForCode(ENOTIMP), DNSNotImplementedError) def test_erefused(self): """ L{ResolverBase.exceptionForCode} converts L{EREFUSED} to L{DNSQueryRefusedError}. """ self.assertIs(self.exceptionForCode(EREFUSED), DNSQueryRefusedError) def test_other(self): """ L{ResolverBase.exceptionForCode} converts any other response code to L{DNSUnknownError}. """ self.assertIs(self.exceptionForCode(object()), DNSUnknownError) class QueryTests(SynchronousTestCase): """ Tests for L{ResolverBase.query}. """ def test_resolverBaseProvidesIResolver(self): """ L{ResolverBase} provides the L{IResolver} interface. """ verifyClass(IResolver, ResolverBase) def test_typeToMethodDispatch(self): """ L{ResolverBase.query} looks up a method to invoke using the type of the query passed to it and the C{typeToMethod} mapping on itself. """ results = [] resolver = ResolverBase() resolver.typeToMethod = { 12345: lambda query, timeout: results.append((query, timeout)) } query = Query(name=b"example.com", type=12345) resolver.query(query, 123) self.assertEqual([(b"example.com", 123)], results) def test_typeToMethodResult(self): """ L{ResolverBase.query} returns a L{Deferred} which fires with the result of the method found in the C{typeToMethod} mapping for the type of the query passed to it. """ expected = object() resolver = ResolverBase() resolver.typeToMethod = {54321: lambda query, timeout: expected} query = Query(name=b"example.com", type=54321) queryDeferred = resolver.query(query, 123) result = [] queryDeferred.addBoth(result.append) self.assertEqual(expected, result[0]) def test_unknownQueryType(self): """ L{ResolverBase.query} returns a L{Deferred} which fails with L{NotImplementedError} when called with a query of a type not present in its C{typeToMethod} dictionary. """ resolver = ResolverBase() resolver.typeToMethod = {} query = Query(name=b"example.com", type=12345) queryDeferred = resolver.query(query, 123) result = [] queryDeferred.addBoth(result.append) self.assertIsInstance(result[0], Failure) result[0].trap(NotImplementedError)
Close