X7ROOT File Manager
Current Path:
/opt/gsutil/third_party/cachetools/tests
opt
/
gsutil
/
third_party
/
cachetools
/
tests
/
📁
..
📄
__init__.py
(9.51 KB)
📄
test_cache.py
(148 B)
📄
test_cached.py
(8.19 KB)
📄
test_cachedmethod.py
(6.89 KB)
📄
test_fifo.py
(1.34 KB)
📄
test_func.py
(5.26 KB)
📄
test_keys.py
(4.66 KB)
📄
test_lfu.py
(1.17 KB)
📄
test_lru.py
(1.34 KB)
📄
test_mru.py
(1.87 KB)
📄
test_rr.py
(831 B)
📄
test_tlru.py
(7.96 KB)
📄
test_ttl.py
(5.85 KB)
Editing: test_rr.py
import unittest from cachetools import RRCache from . import CacheTestMixin class RRCacheTest(unittest.TestCase, CacheTestMixin): Cache = RRCache def test_rr(self): cache = RRCache(maxsize=2, choice=min) self.assertEqual(min, cache.choice) cache[1] = 1 cache[2] = 2 cache[3] = 3 self.assertEqual(2, len(cache)) self.assertEqual(2, cache[2]) self.assertEqual(3, cache[3]) self.assertNotIn(1, cache) cache[0] = 0 self.assertEqual(2, len(cache)) self.assertEqual(0, cache[0]) self.assertEqual(3, cache[3]) self.assertNotIn(2, cache) cache[4] = 4 self.assertEqual(2, len(cache)) self.assertEqual(3, cache[3]) self.assertEqual(4, cache[4]) self.assertNotIn(0, cache)
Upload File
Create Folder