diff options
author | Erik Johnston <erik@matrix.org> | 2016-01-29 11:33:11 +0000 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2016-01-29 11:33:11 +0000 |
commit | 4fce59f2747d9c73784470e84396a09ae70bbda7 (patch) | |
tree | 9b4233095b23904cf3d3f3e6d535737aad4b4794 /tests/util/test_lrucache.py | |
parent | Directly set self.value (diff) | |
download | synapse-4fce59f2747d9c73784470e84396a09ae70bbda7.tar.xz |
Add tests
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) |