summary refs log tree commit diff
path: root/tests/util/test_lrucache.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2016-01-29 11:33:11 +0000
committerErik Johnston <erik@matrix.org>2016-01-29 11:33:11 +0000
commit4fce59f2747d9c73784470e84396a09ae70bbda7 (patch)
tree9b4233095b23904cf3d3f3e6d535737aad4b4794 /tests/util/test_lrucache.py
parentDirectly set self.value (diff)
downloadsynapse-4fce59f2747d9c73784470e84396a09ae70bbda7.tar.xz
Add tests
Diffstat (limited to 'tests/util/test_lrucache.py')
-rw-r--r--tests/util/test_lrucache.py7
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)