Linux id-dci-web1412.main-hosting.eu 5.14.0-611.20.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Jan 14 06:35:04 EST 2026 x86_64
LiteSpeed
: 2a02:4780:6:1512:0:19fc:adf1:2 | : 216.73.216.85
Cant Read [ /etc/named.conf ]
8.1.34
u435990001
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
/
opt /
gsutil /
third_party /
cachetools /
tests /
[ HOME SHELL ]
Name
Size
Permission
Action
__init__.py
9.51
KB
-rw-r--r--
test_cache.py
148
B
-rw-r--r--
test_cached.py
8.19
KB
-rw-r--r--
test_cachedmethod.py
6.89
KB
-rw-r--r--
test_fifo.py
1.34
KB
-rw-r--r--
test_func.py
5.26
KB
-rw-r--r--
test_keys.py
4.66
KB
-rw-r--r--
test_lfu.py
1.17
KB
-rw-r--r--
test_lru.py
1.34
KB
-rw-r--r--
test_mru.py
1.87
KB
-rw-r--r--
test_rr.py
831
B
-rw-r--r--
test_tlru.py
7.96
KB
-rw-r--r--
test_ttl.py
5.85
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : test_keys.py
import unittest import cachetools.keys class CacheKeysTest(unittest.TestCase): def test_hashkey(self, key=cachetools.keys.hashkey): self.assertEqual(key(), key()) self.assertEqual(hash(key()), hash(key())) self.assertEqual(key(1, 2, 3), key(1, 2, 3)) self.assertEqual(hash(key(1, 2, 3)), hash(key(1, 2, 3))) self.assertEqual(key(1, 2, 3, x=0), key(1, 2, 3, x=0)) self.assertEqual(hash(key(1, 2, 3, x=0)), hash(key(1, 2, 3, x=0))) self.assertNotEqual(key(1, 2, 3), key(3, 2, 1)) self.assertNotEqual(key(1, 2, 3), key(1, 2, 3, x=None)) self.assertNotEqual(key(1, 2, 3, x=0), key(1, 2, 3, x=None)) self.assertNotEqual(key(1, 2, 3, x=0), key(1, 2, 3, y=0)) with self.assertRaises(TypeError): hash(key({})) # untyped keys compare equal self.assertEqual(key(1, 2, 3), key(1.0, 2.0, 3.0)) self.assertEqual(hash(key(1, 2, 3)), hash(key(1.0, 2.0, 3.0))) def methodkey(self, key=cachetools.keys.methodkey): # similar to hashkey(), but ignores its first positional argument self.assertEqual(key("x"), key("y")) self.assertEqual(hash(key("x")), hash(key("y"))) self.assertEqual(key("x", 1, 2, 3), key("y", 1, 2, 3)) self.assertEqual(hash(key("x", 1, 2, 3)), hash(key("y", 1, 2, 3))) self.assertEqual(key("x", 1, 2, 3, x=0), key("y", 1, 2, 3, x=0)) self.assertEqual(hash(key("x", 1, 2, 3, x=0)), hash(key("y", 1, 2, 3, x=0))) self.assertNotEqual(key("x", 1, 2, 3), key("x", 3, 2, 1)) self.assertNotEqual(key("x", 1, 2, 3), key("x", 1, 2, 3, x=None)) self.assertNotEqual(key("x", 1, 2, 3, x=0), key("x", 1, 2, 3, x=None)) self.assertNotEqual(key("x", 1, 2, 3, x=0), key("x", 1, 2, 3, y=0)) with self.assertRaises(TypeError): hash("x", key({})) # untyped keys compare equal self.assertEqual(key("x", 1, 2, 3), key("y", 1.0, 2.0, 3.0)) self.assertEqual(hash(key("x", 1, 2, 3)), hash(key("y", 1.0, 2.0, 3.0))) def test_typedkey(self, key=cachetools.keys.typedkey): self.assertEqual(key(), key()) self.assertEqual(hash(key()), hash(key())) self.assertEqual(key(1, 2, 3), key(1, 2, 3)) self.assertEqual(hash(key(1, 2, 3)), hash(key(1, 2, 3))) self.assertEqual(key(1, 2, 3, x=0), key(1, 2, 3, x=0)) self.assertEqual(hash(key(1, 2, 3, x=0)), hash(key(1, 2, 3, x=0))) self.assertNotEqual(key(1, 2, 3), key(3, 2, 1)) self.assertNotEqual(key(1, 2, 3), key(1, 2, 3, x=None)) self.assertNotEqual(key(1, 2, 3, x=0), key(1, 2, 3, x=None)) self.assertNotEqual(key(1, 2, 3, x=0), key(1, 2, 3, y=0)) with self.assertRaises(TypeError): hash(key({})) # typed keys compare unequal self.assertNotEqual(key(1, 2, 3), key(1.0, 2.0, 3.0)) def test_typedmethodkey(self, key=cachetools.keys.typedmethodkey): # similar to typedkey(), but ignores its first positional argument self.assertEqual(key("x"), key("y")) self.assertEqual(hash(key("x")), hash(key("y"))) self.assertEqual(key("x", 1, 2, 3), key("y", 1, 2, 3)) self.assertEqual(hash(key("x", 1, 2, 3)), hash(key("y", 1, 2, 3))) self.assertEqual(key("x", 1, 2, 3, x=0), key("y", 1, 2, 3, x=0)) self.assertEqual(hash(key("x", 1, 2, 3, x=0)), hash(key("y", 1, 2, 3, x=0))) self.assertNotEqual(key("x", 1, 2, 3), key("x", 3, 2, 1)) self.assertNotEqual(key("x", 1, 2, 3), key("x", 1, 2, 3, x=None)) self.assertNotEqual(key("x", 1, 2, 3, x=0), key("x", 1, 2, 3, x=None)) self.assertNotEqual(key("x", 1, 2, 3, x=0), key("x", 1, 2, 3, y=0)) with self.assertRaises(TypeError): hash(key("x", {})) # typed keys compare unequal self.assertNotEqual(key("x", 1, 2, 3), key("x", 1.0, 2.0, 3.0)) def test_addkeys(self, key=cachetools.keys.hashkey): self.assertIsInstance(key(), tuple) self.assertIsInstance(key(1, 2, 3) + key(4, 5, 6), type(key())) self.assertIsInstance(key(1, 2, 3) + (4, 5, 6), type(key())) self.assertIsInstance((1, 2, 3) + key(4, 5, 6), type(key())) def test_pickle(self, key=cachetools.keys.hashkey): import pickle for k in [key(), key("abc"), key("abc", 123), key("abc", q="abc")]: # white-box test: assert cached hash value is not pickled self.assertEqual(len(k.__dict__), 0) h = hash(k) self.assertEqual(len(k.__dict__), 1) pickled = pickle.loads(pickle.dumps(k)) self.assertEqual(len(pickled.__dict__), 0) self.assertEqual(k, pickled) self.assertEqual(h, hash(pickled))
Close