diff options
author | Mark Haines <mark.haines@matrix.org> | 2016-01-29 14:15:12 +0000 |
---|---|---|
committer | Mark Haines <mark.haines@matrix.org> | 2016-01-29 14:15:12 +0000 |
commit | 47374a33fc195bf44363006070268fd60ffff047 (patch) | |
tree | ea2931512014f5f7361bee5c7f768506adbf783a /tests/util/test_lrucache.py | |
parent | Add config option for setting the trusted id servers, disabling checking the ... (diff) | |
parent | Bump AccountDataAndTagsChangeCache size (diff) | |
download | synapse-47374a33fc195bf44363006070268fd60ffff047.tar.xz |
Merge remote-tracking branch 'origin/develop' into markjh/3pid
Diffstat (limited to 'tests/util/test_lrucache.py')
-rw-r--r-- | tests/util/test_lrucache.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/util/test_lrucache.py b/tests/util/test_lrucache.py index 2cd3d26454..bab366fb7f 100644 --- a/tests/util/test_lrucache.py +++ b/tests/util/test_lrucache.py @@ -19,6 +19,7 @@ from .. import unittest from synapse.util.caches.lrucache import LruCache from synapse.util.caches.treecache import TreeCache + class LruCacheTestCase(unittest.TestCase): def test_get_set(self): @@ -72,3 +73,9 @@ class LruCacheTestCase(unittest.TestCase): self.assertEquals(cache.get(("vehicles", "car")), "vroom") self.assertEquals(cache.get(("vehicles", "train")), "chuff") # Man from del_multi say "Yes". + + def test_clear(self): + cache = LruCache(1) + cache["key"] = 1 + cache.clear() + self.assertEquals(len(cache), 0) |