summary refs log tree commit diff
path: root/tests/storage
diff options
context:
space:
mode:
authorErik Johnston <erikj@jki.re>2017-01-17 11:51:09 +0000
committerGitHub <noreply@github.com>2017-01-17 11:51:09 +0000
commitd11d7cdf875e524ce217ff3b091a07fb1c3b99ae (patch)
tree5f88266e2cc5c5ea5afe564d4488f65af3d227d1 /tests/storage
parentMerge pull request #1810 from matrix-org/erikj/state_auth_splitout_split (diff)
parentTidy up test (diff)
downloadsynapse-d11d7cdf875e524ce217ff3b091a07fb1c3b99ae.tar.xz
Merge pull request #1815 from matrix-org/erikj/iter_cache_size
Optionally measure size of cache by sum of length of values
Diffstat (limited to 'tests/storage')
-rw-r--r--tests/storage/test__base.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/storage/test__base.py b/tests/storage/test__base.py
index ab6095564a..8361dd8cee 100644
--- a/tests/storage/test__base.py
+++ b/tests/storage/test__base.py
@@ -241,7 +241,7 @@ class CacheDecoratorTestCase(unittest.TestCase):
         callcount2 = [0]
 
         class A(object):
-            @cached(max_entries=2)
+            @cached(max_entries=20)  # HACK: This makes it 2 due to cache factor
             def func(self, key):
                 callcount[0] += 1
                 return key
@@ -258,6 +258,10 @@ class CacheDecoratorTestCase(unittest.TestCase):
         self.assertEquals(callcount[0], 2)
         self.assertEquals(callcount2[0], 2)
 
+        yield a.func2("foo")
+        self.assertEquals(callcount[0], 2)
+        self.assertEquals(callcount2[0], 2)
+
         yield a.func("foo3")
 
         self.assertEquals(callcount[0], 3)