Refs #33061 -- Added DummyCache.incr()/decr() tests for nonexistent keys with negative deltas.
This commit is contained in:
parent
3219dd3388
commit
96ab3a1379
|
@ -139,6 +139,8 @@ class DummyCacheTests(SimpleTestCase):
|
||||||
cache.incr('answer')
|
cache.incr('answer')
|
||||||
with self.assertRaises(ValueError):
|
with self.assertRaises(ValueError):
|
||||||
cache.incr('does_not_exist')
|
cache.incr('does_not_exist')
|
||||||
|
with self.assertRaises(ValueError):
|
||||||
|
cache.incr('does_not_exist', -1)
|
||||||
|
|
||||||
def test_decr(self):
|
def test_decr(self):
|
||||||
"Dummy cache values can't be decremented"
|
"Dummy cache values can't be decremented"
|
||||||
|
@ -147,6 +149,8 @@ class DummyCacheTests(SimpleTestCase):
|
||||||
cache.decr('answer')
|
cache.decr('answer')
|
||||||
with self.assertRaises(ValueError):
|
with self.assertRaises(ValueError):
|
||||||
cache.decr('does_not_exist')
|
cache.decr('does_not_exist')
|
||||||
|
with self.assertRaises(ValueError):
|
||||||
|
cache.decr('does_not_exist', -1)
|
||||||
|
|
||||||
def test_touch(self):
|
def test_touch(self):
|
||||||
"""Dummy cache can't do touch()."""
|
"""Dummy cache can't do touch()."""
|
||||||
|
|
Loading…
Reference in New Issue