summaryrefslogtreecommitdiff
path: root/tests/cache/test_decorator.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/cache/test_decorator.py')
-rw-r--r--tests/cache/test_decorator.py18
1 files changed, 16 insertions, 2 deletions
diff --git a/tests/cache/test_decorator.py b/tests/cache/test_decorator.py
index d2c142c..c16bdc3 100644
--- a/tests/cache/test_decorator.py
+++ b/tests/cache/test_decorator.py
@@ -99,6 +99,22 @@ class DecoratorTest(_GenericBackendFixture, TestCase):
go.set(0, 1, 3)
eq_(go(1, 3), 0)
+ def test_explicit_get(self):
+ go = self._fixture(expiration_time=1)
+ eq_(go(1, 2), (1, 1, 2))
+ eq_(go.get(1, 2), (1, 1, 2))
+ eq_(go.get(2, 1), NO_VALUE)
+ eq_(go(2, 1), (2, 2, 1))
+ eq_(go.get(2, 1), (2, 2, 1))
+
+ def test_explicit_get_multi(self):
+ go = self._multi_fixture(expiration_time=1)
+ eq_(go(1, 2), ['1 1', '1 2'])
+ eq_(go.get(1, 2), ['1 1', '1 2'])
+ eq_(go.get(3, 1), [NO_VALUE, '1 1'])
+ eq_(go(3, 1), ['2 3', '1 1'])
+ eq_(go.get(3, 1), ['2 3', '1 1'])
+
def test_explicit_set_multi(self):
go = self._multi_fixture(expiration_time=1)
eq_(go(1, 2), ['1 1', '1 2'])
@@ -385,5 +401,3 @@ class CacheDecoratorTest(_GenericBackendFixture, TestCase):
generate.set({7: 18, 10: 15})
eq_(generate(2, 7, 10), ['2 5', 18, 15])
-
-