MCPcopy
hub / github.com/django/django / test_incr

Method test_incr

tests/cache/tests.py:173–181  ·  tests/cache/tests.py::DummyCacheTests.test_incr

Dummy cache values can't be incremented

(self)

Source from the content-addressed store, hash-verified

171 self.assertNotIn(class="st">"goodbye2", cache)
172
173 def test_incr(self):
174 class="st">"Dummy cache values can&class="cm">#x27;t be incremented"
175 cache.set(class="st">"answer", 42)
176 with self.assertRaises(ValueError):
177 cache.incr(class="st">"answer")
178 with self.assertRaises(ValueError):
179 cache.incr(class="st">"does_not_exist")
180 with self.assertRaises(ValueError):
181 cache.incr(class="st">"does_not_exist", -1)
182
183 def test_decr(self):
184 class="st">"Dummy cache values can&class="cm">#x27;t be decremented"

Callers

nothing calls this directly

Calls 2

setMethod · 0.45
incrMethod · 0.45

Tested by

no test coverage detected