mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-06-28 11:57:07 -04:00
Change Cache to not use *args in its interface
This commit is contained in:
parent
63b1eaf32c
commit
20addfa358
11 changed files with 69 additions and 67 deletions
|
@ -42,12 +42,12 @@ class CacheTestCase(unittest.TestCase):
|
|||
self.assertEquals(self.cache.get("foo"), 123)
|
||||
|
||||
def test_invalidate(self):
|
||||
self.cache.prefill("foo", 123)
|
||||
self.cache.invalidate("foo")
|
||||
self.cache.prefill(("foo",), 123)
|
||||
self.cache.invalidate(("foo",))
|
||||
|
||||
failed = False
|
||||
try:
|
||||
self.cache.get("foo")
|
||||
self.cache.get(("foo",))
|
||||
except KeyError:
|
||||
failed = True
|
||||
|
||||
|
@ -141,7 +141,7 @@ class CacheDecoratorTestCase(unittest.TestCase):
|
|||
|
||||
self.assertEquals(callcount[0], 1)
|
||||
|
||||
a.func.invalidate("foo")
|
||||
a.func.invalidate(("foo",))
|
||||
|
||||
yield a.func("foo")
|
||||
|
||||
|
@ -153,7 +153,7 @@ class CacheDecoratorTestCase(unittest.TestCase):
|
|||
def func(self, key):
|
||||
return key
|
||||
|
||||
A().func.invalidate("what")
|
||||
A().func.invalidate(("what",))
|
||||
|
||||
@defer.inlineCallbacks
|
||||
def test_max_entries(self):
|
||||
|
@ -193,7 +193,7 @@ class CacheDecoratorTestCase(unittest.TestCase):
|
|||
|
||||
a = A()
|
||||
|
||||
a.func.prefill("foo", ObservableDeferred(d))
|
||||
a.func.prefill(("foo",), ObservableDeferred(d))
|
||||
|
||||
self.assertEquals(a.func("foo").result, d.result)
|
||||
self.assertEquals(callcount[0], 0)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue