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

Method test_incr

tests/cache/tests.py:173–181  ·  view source on GitHub ↗

Dummy cache values can't be incremented

(self)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

setMethod · 0.45
incrMethod · 0.45

Tested by

no test coverage detected