From 96ab3a13792c129b9a16c5788e9e0bf3d828564d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sondre=20Lilleb=C3=B8=20Gundersen?= Date: Tue, 31 Aug 2021 07:25:16 +0200 Subject: [PATCH] Refs #33061 -- Added DummyCache.incr()/decr() tests for nonexistent keys with negative deltas. --- tests/cache/tests.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/cache/tests.py b/tests/cache/tests.py index 783055182d..8a2926f3d7 100644 --- a/tests/cache/tests.py +++ b/tests/cache/tests.py @@ -139,6 +139,8 @@ class DummyCacheTests(SimpleTestCase): cache.incr('answer') with self.assertRaises(ValueError): cache.incr('does_not_exist') + with self.assertRaises(ValueError): + cache.incr('does_not_exist', -1) def test_decr(self): "Dummy cache values can't be decremented" @@ -147,6 +149,8 @@ class DummyCacheTests(SimpleTestCase): cache.decr('answer') with self.assertRaises(ValueError): cache.decr('does_not_exist') + with self.assertRaises(ValueError): + cache.decr('does_not_exist', -1) def test_touch(self): """Dummy cache can't do touch()."""