summary refs log tree commit diff
path: root/tests/util/test_lrucache.py
diff options
context:
space:
mode:
authorAndrew Morgan <andrew@amorgan.xyz>2020-12-31 11:43:55 +0000
committerAndrew Morgan <andrew@amorgan.xyz>2020-12-31 11:43:55 +0000
commit8f05de1d97fc67786e9e1d2ba1a79ffb4dafb865 (patch)
tree11be269c222a7a1ae73efd131d48151cb174ac1b /tests/util/test_lrucache.py
parentMerge commit '97647b33c' into dinsic (diff)
parentAdd type hints to profile and base handlers. (#8609) (diff)
downloadsynapse-8f05de1d97fc67786e9e1d2ba1a79ffb4dafb865.tar.xz
Merge commit 'de5cafe98' into dinsic
Diffstat (limited to 'tests/util/test_lrucache.py')
-rw-r--r--tests/util/test_lrucache.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/util/test_lrucache.py b/tests/util/test_lrucache.py

index f12834edab..a739a6aaaf 100644 --- a/tests/util/test_lrucache.py +++ b/tests/util/test_lrucache.py
@@ -19,7 +19,8 @@ from mock import Mock from synapse.util.caches.lrucache import LruCache from synapse.util.caches.treecache import TreeCache -from .. import unittest +from tests import unittest +from tests.unittest import override_config class LruCacheTestCase(unittest.HomeserverTestCase): @@ -83,6 +84,11 @@ class LruCacheTestCase(unittest.HomeserverTestCase): cache.clear() self.assertEquals(len(cache), 0) + @override_config({"caches": {"per_cache_factors": {"mycache": 10}}}) + def test_special_size(self): + cache = LruCache(10, "mycache") + self.assertEqual(cache.max_size, 100) + class LruCacheCallbacksTestCase(unittest.HomeserverTestCase): def test_get(self):