Linux iad1-shared-b7-18 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
Apache
: 67.205.6.31 | : 216.73.216.47
Cant Read [ /etc/named.conf ]
8.2.29
fernandoquevedo
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
README
+ Create Folder
+ Create File
/
usr /
lib /
python3 /
dist-packages /
genshi /
tests /
[ HOME SHELL ]
Name
Size
Permission
Action
__pycache__
[ DIR ]
drwxr-xr-x
__init__.py
1.07
KB
-rw-r--r--
builder.py
2.84
KB
-rw-r--r--
core.py
9.51
KB
-rw-r--r--
input.py
12.07
KB
-rw-r--r--
output.py
21.46
KB
-rw-r--r--
path.py
26.97
KB
-rw-r--r--
test_utils.py
602
B
-rw-r--r--
util.py
3.05
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : util.py
# -*- coding: utf-8 -*- # # Copyright (C) 2006,2009 Edgewall Software # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at http://genshi.edgewall.org/wiki/License. # # This software consists of voluntary contributions made by many # individuals. For the exact contribution history, see the revision # history and logs, available at http://genshi.edgewall.org/log/. import unittest from genshi import util from genshi.tests.test_utils import doctest_suite from genshi.util import LRUCache class LRUCacheTestCase(unittest.TestCase): def test_setitem(self): cache = LRUCache(2) cache['A'] = 0 self.assertEqual(1, len(cache)) self.assertEqual('A', cache.head.key) self.assertEqual('A', cache.tail.key) item_a = cache._dict['A'] self.assertEqual('A', item_a.key) self.assertEqual(0, item_a.value) self.assertEqual(None, item_a.prv) self.assertEqual(None, item_a.nxt) cache['B'] = 1 self.assertEqual(2, len(cache)) self.assertEqual('B', cache.head.key) self.assertEqual('A', cache.tail.key) item_a = cache._dict['A'] item_b = cache._dict['B'] self.assertEqual('A', item_a.key) self.assertEqual(0, item_a.value) self.assertEqual(item_b, item_a.prv) self.assertEqual(None, item_a.nxt) self.assertEqual('B', item_b.key) self.assertEqual(1, item_b.value) self.assertEqual(None, item_b.prv) self.assertEqual(item_a, item_b.nxt) cache['C'] = 2 self.assertEqual(2, len(cache)) self.assertEqual('C', cache.head.key) self.assertEqual('B', cache.tail.key) item_b = cache._dict['B'] item_c = cache._dict['C'] self.assertEqual('B', item_b.key) self.assertEqual(1, item_b.value) self.assertEqual(item_c, item_b.prv) self.assertEqual(None, item_b.nxt) self.assertEqual('C', item_c.key) self.assertEqual(2, item_c.value) self.assertEqual(None, item_c.prv) self.assertEqual(item_b, item_c.nxt) def test_getitem(self): cache = LRUCache(2) cache['A'] = 0 cache['B'] = 1 cache['A'] self.assertEqual(2, len(cache)) self.assertEqual('A', cache.head.key) self.assertEqual('B', cache.tail.key) item_a = cache._dict['A'] item_b = cache._dict['B'] self.assertEqual('A', item_a.key) self.assertEqual(0, item_a.value) self.assertEqual(None, item_a.prv) self.assertEqual(item_b, item_a.nxt) self.assertEqual('B', item_b.key) self.assertEqual(1, item_b.value) self.assertEqual(item_a, item_b.prv) self.assertEqual(None, item_b.nxt) def suite(): suite = unittest.TestSuite() suite.addTest(doctest_suite(util)) suite.addTest(unittest.makeSuite(LRUCacheTestCase, 'test')) return suite if __name__ == '__main__': unittest.main(defaultTest='suite')
Close