mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-03 00:24:54 -04:00
Add tests
This commit is contained in:
parent
fb7299800f
commit
4fce59f274
2 changed files with 19 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue